[IPython-dev] IPython console crashes when interrupted in routine

Gregory Simonian simonian.7 at buckeyemail.osu.edu
Sat Mar 21 14:38:30 EDT 2015


Hey everyone,

I think I ran into a regression in IPython 3.0 where whenever I
interrupt running code, the IPython console and kernel crash. Probably
the easiest way I know to reproduce this is:
$ ipython console
In [1]: for i in range(1000000):
   ...:    print i
   ...:
And then press Ctrl-C during execution.

I expect that it will catch a KeyboardInterrupt exception and then go
back to an IPython prompt. However, instead it outputs:
Out [1]: 1
2
<...>
41654^CTraceback (most recent call last):
  File "/usr/custom/Anaconda-2.0.1/bin/ipython", line 6, in <module>
    sys.exit(start_ipython())
  File
"/usr/custom/Anaconda-2.0.1/lib/python2.7/site-packages/IPython/__init__.py",
line 120, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File
"/usr/custom/Anaconda-2.0.1/lib/python2.7/site-packages/IPython/config/application.py",
line 574, in launch_instance
    app.start()
  File
"/usr/custom/Anaconda-2.0.1/lib/python2.7/site-packages/IPython/terminal/ipapp.py",
line 367, in start
    return self.subapp.start()
  File
"/usr/custom/Anaconda-2.0.1/lib/python2.7/site-packages/IPython/terminal/ipapp.py",
line 371, in start
    self.shell.mainloop()
  File
"/usr/custom/Anaconda-2.0.1/lib/python2.7/site-packages/IPython/terminal/console/interactiveshell.py",
line 407, in mainloop
    self.interact(display_banner=display_banner)
  File
"/usr/custom/Anaconda-2.0.1/lib/python2.7/site-packages/IPython/terminal/console/interactiveshell.py",
line 568, in interact
    self.run_cell(source_raw)
  File
"/usr/custom/Anaconda-2.0.1/lib/python2.7/site-packages/IPython/terminal/console/interactiveshell.py",
line 168, in run_cell
    self.handle_input_request(msg_id, timeout=0.05)
  File
"/usr/custom/Anaconda-2.0.1/lib/python2.7/site-packages/IPython/terminal/console/interactiveshell.py",
line 373, in handle_input_request
    req = self.client.stdin_channel.get_msg(timeout=timeout)
  File
"/usr/custom/Anaconda-2.0.1/lib/python2.7/site-packages/IPython/kernel/blocking/channels.py",
line 50, in get_msg
    ready = self.socket.poll(timeout)
  File
"/usr/custom/Anaconda-2.0.1/lib/python2.7/site-packages/zmq/sugar/socket.py",
line 448, in poll
    evts = dict(p.poll(timeout))
  File
"/usr/custom/Anaconda-2.0.1/lib/python2.7/site-packages/zmq/sugar/poll.py",
line 101, in poll
    return zmq_poll(self.sockets, timeout=timeout)
  File "zmq/backend/cython/_poll.pyx", line 115, in
zmq.backend.cython._poll.zmq_poll (zmq/backend/cython/_poll.c:1586)
  File "zmq/backend/cython/checkrc.pxd", line 21, in
zmq.backend.cython.checkrc._check_rc (zmq/backend/cython/_poll.c:2016)
    raise ZMQError(errno)
ZMQError: Interrupted system call

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev at scipy.org

You can print a more detailed traceback right now with "%tb", or use
"%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    %config Application.verbose_crash=True
$

Dropping me back at the shell. This doesn't occur in just running plain
"$ ipython", so the kernel should have something to do with it.

I am running IPython 3.0 through Anaconda on CentOS 6.6.I hadn't
encountered this bug in IPython 2. Maybe other people can confirm if it
occurs for them. And if so, what additional info I would need to file a
bug report. Thanks!

                                                             Gregory
Simonian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150321/b0ea1123/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150321/b0ea1123/attachment.sig>


More information about the IPython-dev mailing list