[Python-modules-team] Bug#943901: ipykernel: failing tests with python3.8

Steve Langasek steve.langasek at canonical.com
Thu Oct 31 15:58:38 GMT 2019


Package: ipykernel
Version: 4.9.0-2
Severity: important
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu focal ubuntu-patch

Dear maintainers,

The ipykernel package fails to build from source in Ubuntu focal, because
Ubuntu has begun the transition to python3.8 and ipykernel 4.9.0 is not
source-compatible with python3.8:

[...]
======================================================================
ERROR: Does executing code in an in-process kernel work?
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/ipykernel/inprocess/tests/test_kernelmanager.py", line 63, in test_execute
    assert km.kernel.shell.user_ns['foo'] == 1
KeyError: 'foo'
-------------------- >> begin captured stdout << ---------------------
status
status

--------------------- >> end captured stdout << ----------------------
-------------------- >> begin captured logging << --------------------
asyncio: DEBUG: Using selector: EpollSelector
ipykernel.inprocess.ipkernel: DEBUG: 
*** MESSAGE TYPE:kernel_info_request***
ipykernel.inprocess.ipkernel: DEBUG:    Content: {}
   --->
   
ipykernel.inprocess.ipkernel: DEBUG: kernel_info_request: {'header': {'msg_id': 'ea45d6d2-e4a08f7948d5f1853d12015e', 'msg_type': 'kernel_info_request', 'username': 'buildd', 'session': '903e4bd4-9ea897ba7f841240791a9cec', 'date': datetime.datetime(2019, 10, 28, 13, 23, 42, 542565, tzinfo=tzlocal()), 'version': '5.3'}, 'msg_id': 'ea45d6d2-e4a08f7948d5f1853d12015e', 'msg_type': 'kernel_info_request', 'parent_header': {}, 'metadata': {}, 'content': {}, 'buffers': []}
ipykernel.inprocess.ipkernel: DEBUG: {'header': {'msg_id': '2c3237e1-51c523aa6cb893a3872aea62', 'msg_type': 'kernel_info_reply', 'username': 'buildd', 'session': '903e4bd4-9ea897ba7f841240791a9cec', 'date': datetime.datetime(2019, 10, 28, 13, 23, 42, 544275, tzinfo=datetime.timezone.utc), 'version': '5.3'}, 'msg_id': '2c3237e1-51c523aa6cb893a3872aea62', 'msg_type': 'kernel_info_reply', 'parent_header': {'msg_id': 'ea45d6d2-e4a08f7948d5f1853d12015e', 'msg_type': 'kernel_info_request', 'username': 'buildd', 'session': '903e4bd4-9ea897ba7f841240791a9cec', 'date': datetime.datetime(2019, 10, 28, 13, 23, 42, 542565, tzinfo=tzlocal()), 'version': '5.3'}, 'content': {'status': 'ok', 'protocol_version': '5.1', 'implementation': 'ipython', 'implementation_version': '5.8.0', 'language_info': {'name': 'python', 'version': '3.8.0', 'mimetype': 'text/x-python', 'codemirror_mode': {'name': 'ipython', 'version': 3}, 'pygments_lexer': 'ipython3', 'nbconvert_exporter': 'python', 'file_extension': '.py'}, 'banner': 'Python 3.8.0 (default, Oct 27 2019, 15:36:55) \nType "copyright", "credits" or "license" for more information.\n\nIPython 5.8.0 -- An enhanced Interactive Python.\n?         -> Introduction and overview of IPython\'s features.\n%quickref -> Quick reference.\nhelp      -> Python\'s own help system.\nobject?   -> Details about \'object\', use \'object??\' for extra details.\n', 'help_links': [{'text': 'Python Reference', 'url': 'https://docs.python.org/3.8'}, {'text': 'IPython Reference', 'url': 'https://ipython.org/documentation.html'}, {'text': 'NumPy Reference', 'url': 'https://docs.scipy.org/doc/numpy/reference/'}, {'text': 'SciPy Reference', 'url': 'https://docs.scipy.org/doc/scipy/reference/'}, {'text': 'Matplotlib Reference', 'url': 'https://matplotlib.org/contents.html'}, {'text': 'SymPy Reference', 'url': 'http://docs.sympy.org/latest/index.html'}, {'text': 'pandas Reference', 'url': 'https://pandas.pydata.org/pandas-docs/stable/'}]}, 'metadata': {}, 'tracker': <zmq.sugar.tracker.MessageTracker object at 0x7f122a1b8220>}
ipykernel.inprocess.ipkernel: DEBUG: 
*** MESSAGE TYPE:execute_request***
ipykernel.inprocess.ipkernel: DEBUG:    Content: {'code': 'foo = 1', 'silent': False, 'store_history': True, 'user_expressions': {}, 'allow_stdin': True}
   --->
   
ipykernel.inprocess.ipkernel: DEBUG: execute_request: {'header': {'msg_id': '88b61e78-dea95246add40e9375153a50', 'msg_type': 'execute_request', 'username': 'buildd', 'session': '903e4bd4-9ea897ba7f841240791a9cec', 'date': datetime.datetime(2019, 10, 28, 13, 23, 42, 747395, tzinfo=tzlocal()), 'version': '5.3'}, 'msg_id': '88b61e78-dea95246add40e9375153a50', 'msg_type': 'execute_request', 'parent_header': {}, 'metadata': {}, 'content': {'code': 'foo = 1', 'silent': False, 'store_history': True, 'user_expressions': {}, 'allow_stdin': True}, 'buffers': []}
ipykernel.inprocess.ipkernel: INFO: Exception in execute request:
ESC[0;31m---------------------------------------------------------------------------ESC[0m
ESC[0;31mTypeErrorESC[0m                                 Traceback (most recent call last)
ESC[0;32m/usr/lib/python3.8/codeop.pyESC[0m in ESC[0;36m__call__ESC[0;34m(self, source, filename, symbol)ESC[0m
ESC[1;32m    131ESC[0m ESC[0;34mESC[0mESC[0m
ESC[1;32m    132ESC[0m     ESC[0;32mdefESC[0m ESC[0m__call__ESC[0mESC[0;34m(ESC[0mESC[0mselfESC[0mESC[0;34m,ESC[0m ESC[0msourceESC[0mESC[0;34m,ESC[0m ESC[0mfilenameESC[0mESC[0;34m,ESC[0m ESC[0msymbolESC[0mESC[0;34m)ESC[0mESC[0;34m:ESC[0mESC[0;34mESC[0mESC[0;34mESC[0mESC[0m
ESC[0;32m--> 133ESC[0;31m         ESC[0mcodeobESC[0m ESC[0;34m=ESC[0m ESC[0mcompileESC[0mESC[0;34m(ESC[0mESC[0msourceESC[0mESC[0;34m,ESC[0m ESC[0mfilenameESC[0mESC[0;34m,ESC[0m ESC[0msymbolESC[0mESC[0;34m,ESC[0m ESC[0mselfESC[0mESC[0;34m.
ESC[0mESC[0mflagsESC[0mESC[0;34m,ESC[0m ESC[0;36m1ESC[0mESC[0;34m)ESC[0mESC[0;34mESC[0mESC[0;34mESC[0mESC[0m
ESC[0mESC[1;32m    134ESC[0m         ESC[0;32mforESC[0m ESC[0mfeatureESC[0m ESC[0;32minESC[0m ESC[0m_featuresESC[0mESC[0;34m:ESC[0mESC[0;34mESC[0mESC[0;34mESC[0mESC[0m
ESC[1;32m    135ESC[0m             ESC[0;32mifESC[0m ESC[0mcodeobESC[0mESC[0;34m.ESC[0mESC[0mco_flagsESC[0m ESC[0;34m&ESC[0m ESC[0mfeatureESC[0mESC[0;34m.ESC[0mESC[0mcompiler_flagESC[0mESC[0;34m:ESC[0mESC[0;34mESC[0mESC[0;34mESC[0mESC[0m

ESC[0;31mTypeErrorESC[0m: required field "type_ignores" missing from Module
ipykernel.inprocess.ipkernel: DEBUG: {'header': {'msg_id': '01e84fd2-184f9c5a889b0c3689d4e75f', 'msg_type': 'execute_reply', 'username': 'buildd', 'session': '903e4bd4-9ea897ba7f841240791a9cec', 'date': datetime.datetime(2019, 10, 28, 13, 23, 42, 758260, tzinfo=datetime.timezone.utc), 'version': '5.3'}, 'msg_id': '01e84fd2-184f9c5a889b0c3689d4e75f', 'msg_type': 'execute_reply', 'parent_header': {'msg_id': '88b61e78-dea95246add40e9375153a50', 'msg_type': 'execute_request', 'username': 'buildd', 'session': '903e4bd4-9ea897ba7f841240791a9cec', 'date': datetime.datetime(2019, 10, 28, 13, 23, 42, 747395, tzinfo=tzlocal()), 'version': '5.3'}, 'content': {'status': 'error', 'traceback': ['\x1b[0;31m---------------------------------------------------------------------------\x1b[0m', '\x1b[0;31mTypeError\x1b[0m                                 Traceback (most recent call last)', '\x1b[0;32m/usr/lib/python3.8/codeop.py\x1b[0m in \x1b[0;36m__call__\x1b[0;34m(self, source, filename, symbol)\x1b[0m\n\x1b[1;32m    131\x1b[0m \x1b[0;34m\x1b[0m\x1b[0m\n\x1b[1;32m    132\x1b[0m     \x1b[0;32mdef\x1b[0m \x1b[0m__call__\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0mself\x1b[0m\x1b[0;34m,\x1b[0m \x1b[0msource\x1b[0m\x1b[0;34m,\x1b[0m \x1b[0mfilename\x1b[0m\x1b[0;34m,\x1b[0m \x1b[0msymbol\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m:\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n\x1b[0;32m--> 133\x1b[0;31m         \x1b[0mcodeob\x1b[0m \x1b[0;34m=\x1b[0m \x1b[0mcompile\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0msource\x1b[0m\x1b[0;34m,\x1b[0m \x1b[0mfilename\x1b[0m\x1b[0;34m,\x1b[0m \x1b[0msymbol\x1b[0m\x1b[0;34m,\x1b[0m \x1b[0mself\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0mflags\x1b[0m\x1b[0;34m,\x1b[0m \x1b[0;36m1\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n\x1b[0m\x1b[1;32m    134\x1b[0m         \x1b[0;32mfor\x1b[0m \x1b[0mfeature\x1b[0m \x1b[0;32min\x1b[0m \x1b[0m_features\x1b[0m\x1b[0;34m:\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n\x1b[1;32m    135\x1b[0m             \x1b[0;32mif\x1b[0m \x1b[0mcodeob\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0mco_flags\x1b[0m \x1b[0;34m&\x1b[0m \x1b[0mfeature\x1b[0m\x1b[0;34m.\x1b[0m\x1b[0mcompiler_flag\x1b[0m\x1b[0;34m:\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n', '\x1b[0;31mTypeError\x1b[0m: required field "type_ignores" missing from Module'], 'ename': 'TypeError', 'evalue': 'required field "type_ignores" missing from Module', 'engine_info': {'engine_uuid': '3d373199-bd06-4d81-b5fe-aa83098089c5', 'engine_id': -1, 'method': 'execute'}, 'execution_count': 4, 'user_expressions': {}, 'payload': []}, 'metadata': {'started': datetime.datetime(2019, 10, 28, 13, 23, 42, 749296, tzinfo=datetime.timezone.utc), 'dependencies_met': True, 'engine': '3d373199-bd06-4d81-b5fe-aa83098089c5', 'status': 'error'}, 'tracker': <zmq.sugar.tracker.MessageTracker object at 0x7f122a1b8220>}
--------------------- >> end captured logging << ---------------------

[...]

  (https://launchpad.net/ubuntu/+source/ipykernel/4.9.0-2/+build/17963855)

Debian has not yet started the transition to python3.8 - the version of
python3-defaults that adds python3.8 as supported is currently in
experimental - but this will eventually become a serious bug in Debian as
well once that transition begins.

For the moment I have worked around the failure in Ubuntu by changing the
packaging to test only against the current version of python3 and not
against all supported versions, but this is a very short-term fix given that
python3.8 will become the default in the next 6 months.

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
diff -Nru ipykernel-4.9.0/debian/control ipykernel-4.9.0/debian/control
--- ipykernel-4.9.0/debian/control	2019-10-09 11:06:42.000000000 -0700
+++ ipykernel-4.9.0/debian/control	2019-10-31 08:54:01.000000000 -0700
@@ -19,7 +19,7 @@
                python-setuptools,
                python-tornado,
                python-traitlets,
-               python3-all,
+               python3,
                python3-ipython,
                python3-jupyter-client,
                python3-matplotlib,


More information about the Python-modules-team mailing list