Bug#893360: python3-tornado 5.0.0 breaks python3-zmq

2018-03-18 Thread Rebecca N. Palmer
This is because tornado 5.0 deliberately removed 
ioloop.IOLoop.initialized() because "It is no longer possible to provide 
this method with reasonable semantics": 
https://github.com/tornadoweb/tornado/commit/426b3812b9dd21ae0bac19d4146c6952816c7bfe#diff-1d4144f0ef561b7c18c7fe438816e1f5


This bug probably doesn't affect pyzmq 17 (since
https://github.com/zeromq/pyzmq/commit/f24a264094c6aae2587279c052fcbe242dd9d157#diff-079289d3903c2adcc75b3beb3458a2cf 
), but I don't know whether upgrading Debian's pyzmq to that would break 
anything else.


Another option is to remove this assert() (zmq/eventloop/ioloop.py:210) 
or move it inside a tornado_version check.


It is likely that both Python 2 and 3 are affected, but I have not tried 
to verify this.  At least Jupyter/ipykernel (via 
python3-jupyter-client), sagemath, circus and salt-{master,minion} 
Depend: on both python(3)-tornado and python(3)-zmq, but I have only 
tested the first.


Stack trace (this input file is 
https://salsa.debian.org/science-team/theano/blob/master/doc/library/d3viz/index.ipynb 
, but any .ipynb file would probably do):


# apt-get install jupyter-nbconvert python3-ipykernel
$ jupyter-nbconvert --to notebook --execute --allow-errors index.ipynb
[NbConvertApp] Converting notebook index.ipynb to notebook
[NbConvertApp] Executing notebook with kernel: python3
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "/usr/lib/python3/dist-packages/ipykernel_launcher.py", line 16, 
in 

app.launch_new_instance()
  File 
"/usr/lib/python3/dist-packages/traitlets/config/application.py", line 
657, in launch_instance

app.initialize(argv)
  File "", line 2, in initialize
  File 
"/usr/lib/python3/dist-packages/traitlets/config/application.py", line 
87, in catch_config_error

return method(app, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/ipykernel/kernelapp.py", line 
452, in initialize

zmq_ioloop.install()
  File "/usr/lib/python3/dist-packages/zmq/eventloop/ioloop.py", line 
210, in install

assert (not ioloop.IOLoop.initialized()) or \
AttributeError: type object 'IOLoop' has no attribute 'initialized'
Traceback (most recent call last):
  File "/usr/bin/jupyter-nbconvert", line 11, in 
load_entry_point('nbconvert==5.3.1', 'console_scripts', 
'jupyter-nbconvert')()
  File "/usr/lib/python3/dist-packages/jupyter_core/application.py", 
line 266, in launch_instance

return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File 
"/usr/lib/python3/dist-packages/traitlets/config/application.py", line 
658, in launch_instance

app.start()
  File "/usr/lib/python3/dist-packages/nbconvert/nbconvertapp.py", line 
325, in start

self.convert_notebooks()
  File "/usr/lib/python3/dist-packages/nbconvert/nbconvertapp.py", line 
493, in convert_notebooks

self.convert_single_notebook(notebook_filename)
  File "/usr/lib/python3/dist-packages/nbconvert/nbconvertapp.py", line 
464, in convert_single_notebook
output, resources = self.export_single_notebook(notebook_filename, 
resources, input_buffer=input_buffer)
  File "/usr/lib/python3/dist-packages/nbconvert/nbconvertapp.py", line 
393, in export_single_notebook
output, resources = self.exporter.from_filename(notebook_filename, 
resources=resources)
  File 
"/usr/lib/python3/dist-packages/nbconvert/exporters/exporter.py", line 
174, in from_filename

return self.from_file(f, resources=resources, **kw)
  File 
"/usr/lib/python3/dist-packages/nbconvert/exporters/exporter.py", line 
192, in from_file
return self.from_notebook_node(nbformat.read(file_stream, 
as_version=4), resources=resources, **kw)
  File 
"/usr/lib/python3/dist-packages/nbconvert/exporters/notebook.py", line 
31, in from_notebook_node
nb_copy, resources = super(NotebookExporter, 
self).from_notebook_node(nb, resources, **kw)
  File 
"/usr/lib/python3/dist-packages/nbconvert/exporters/exporter.py", line 
134, in from_notebook_node

nb_copy, resources = self._preprocess(nb_copy, resources)
  File 
"/usr/lib/python3/dist-packages/nbconvert/exporters/exporter.py", line 
311, in _preprocess

nbc, resc = preprocessor(nbc, resc)
  File 
"/usr/lib/python3/dist-packages/nbconvert/preprocessors/base.py", line 
47, in __call__

return self.preprocess(nb, resources)
  File 
"/usr/lib/python3/dist-packages/nbconvert/preprocessors/execute.py", 
line 257, in preprocess

cwd=path)
  File 
"/usr/lib/python3/dist-packages/nbconvert/preprocessors/execute.py", 
line 241, in start_new_kernel

kc.wait_for_ready(timeout=startup_timeout)
  File 
"/usr/lib/python3/dist-packages/jupyter_client/blocking/client.py", line 
120, in wait_for_ready

raise RuntimeError('Kernel died before replying to kernel_info')
RuntimeError: Kernel died before replying to kernel_info
$



Bug#893360: python3-tornado 5.0.0 breaks python3-zmq

2018-03-18 Thread Michael Olbrich
Package: python3-tornado
Version: 5.0.0-1
Severity: normal

Dear Maintainer,

I'm using python3-tornado indirectly with IPython. With the update to
python3-tornado 5.0.0-1 this is broken. The testcase to reproduce this is
simple:

import IPython
IPython.embed_kernel()

With the new version this results in:

Traceback (most recent call last):
  File "./test.py", line 3, in 
IPython.embed_kernel()
  File "/usr/lib/python3/dist-packages/IPython/__init__.py", line 91, in 
embed_kernel
real_embed_kernel(module=module, local_ns=local_ns, **kwargs)
  File "/usr/lib/python3/dist-packages/ipykernel/embed.py", line 38, in 
embed_kernel
app.initialize([])
  File "", line 2, in initialize
  File "/usr/lib/python3/dist-packages/traitlets/config/application.py", line 
87, in catch_config_error
return method(app, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/ipykernel/kernelapp.py", line 452, in 
initialize
zmq_ioloop.install()
  File "/usr/lib/python3/dist-packages/zmq/eventloop/ioloop.py", line 210, in 
install
assert (not ioloop.IOLoop.initialized()) or \
AttributeError: type object 'IOLoop' has no attribute 'initialized'

It seems to me that the python3-tornado API changed in version 5.x and
python3-zmq does not support this. I'm using python3-zmq 16.0.2-2+b1 and
python3-ipykernel 4.8.2-2 here.

Downgrading python3-tornado to 4.5.3-1 'fixes' the problem for me.

-- System Information:
Debian Release: buster/sid
  APT prefers experimental
  APT policy: (900, 'experimental'), (900, 'unstable'), (600, 'testing'), (550, 
'stable'), (500, 'unstable-debug'), (500, 'testing-debug')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.15.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8), 
LANGUAGE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages python3-tornado depends on:
ii  ca-certificates  20170717
ii  libc62.27-2
ii  python3  3.6.4-1

python3-tornado recommends no packages.

Versions of packages python3-tornado suggests:
pn  python-tornado-doc  
ii  python3-pycurl  7.43.0.1-0.2
pn  python3-twisted 

-- no debconf information