{"action":"created","issue":{"url":"https://api.github.com/repos/ipython/ipython/issues/7685","labels_url":"https://api.github.com/repos/ipython/ipython/issues/7685/labels{/name}","comments_url":"https://api.github.com/repos/ipython/ipython/issues/7685/comments","events_url":"https://api.github.com/repos/ipython/ipython/issues/7685/events","html_url":"https://github.com/ipython/ipython/issues/7685","id":56572705,"number":7685,"title":"Pressing \"Interrupt Kernel\" kills kernel","user":{"login":"juhasch","id":2445216,"avatar_url":"https://avatars.githubusercontent.com/u/2445216?v=3","gravatar_id":"","url":"https://api.github.com/users/juhasch","html_url":"https://github.com/juhasch","followers_url":"https://api.github.com/users/juhasch/followers","following_url":"https://api.github.com/users/juhasch/following{/other_user}","gists_url":"https://api.github.com/users/juhasch/gists{/gist_id}","starred_url":"https://api.github.com/users/juhasch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juhasch/subscriptions","organizations_url":"https://api.github.com/users/juhasch/orgs","repos_url":"https://api.github.com/users/juhasch/repos","events_url":"https://api.github.com/users/juhasch/events{/privacy}","received_events_url":"https://api.github.com/users/juhasch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-04T19:11:56Z","updated_at":"2015-02-04T20:30:47Z","closed_at":null,"body":"When I  press the \"Interrupt Kernel\" button in the notebook, the kernel dies.\r\nSystem: Windows 7, Anaconda Python 3.4.1 and current IPython master.\r\n\r\nThis is the log:\r\n```\r\n[I 20:06:14.782 NotebookApp] Using existing profile dir: 'C:\\\\Users\\\\hasch\\\\.ipython\\\\profile_default'\r\n[I 20:06:14.792 NotebookApp] Serving local MathJax from C:\\Users\\hasch\\.ipython\\nbextensions\\mathjax\\MathJax.js at /nbex\r\ntensions/mathjax/MathJax.js\r\n[I 20:06:15.037 NotebookApp] Serving notebooks from local directory: i:\\notebook\r\n[I 20:06:15.037 NotebookApp] 0 active kernels\r\n[I 20:06:15.037 NotebookApp] The IPython Notebook is running at: http://localhost:8888/\r\n[I 20:06:15.037 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).\r\n[I 20:06:19.899 NotebookApp] Kernel started: 393b742e-b876-4e59-9e74-21e79f9e5169\r\n[I 20:06:23.549 NotebookApp] Kernel interrupted: 393b742e-b876-4e59-9e74-21e79f9e5169\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\nc:\\Anaconda\\lib\\runpy.py in _run_module_as_main(mod_name='IPython.kernel.__main__', alter_argv=1)\r\n    168         sys.argv[0] = mod_spec.origin\r\n    169     return _run_code(code, main_globals, None,\r\n--> 170                      \"__main__\", mod_spec)\r\n        mod_spec = ModuleSpec(name='IPython.kernel.__main__', loader=<_frozen_importlib.SourceFileLoader object at 0x000\r\n0000001F1D9B0>, origin='c:\\\\Anaconda\\\\lib\\\\site-packages\\\\IPython\\\\kernel\\\\__main__.py')\r\n    171\r\n    172 def run_module(mod_name, init_globals=None,\r\n\r\nc:\\Anaconda\\lib\\runpy.py in _run_code(code=<code object <module> at 0x00000000025AC5D0, fil...ite-packages\\IPython\\kerne\r\nl\\__main__.py\", line 1>, run_globals={'__builtins__': <module 'builtins' (built-in)>, '__cached__': r'c:\\Anaconda\\lib\\si\r\nte-packages\\IPython\\kernel\\__pycache__\\__main__.cpython-34.pyc', '__doc__': None, '__file__': r'c:\\Anaconda\\lib\\site-pac\r\nkages\\IPython\\kernel\\__main__.py', '__loader__': <_frozen_importlib.SourceFileLoader object>, '__name__': '__main__', '_\r\n_package__': 'IPython.kernel', '__spec__': ModuleSpec(name='IPython.kernel.__main__', loade...ib\\\\site-packages\\\\IPython\r\n\\\\kernel\\\\__main__.py'), 'app': <module 'IPython.kernel.zmq.kernelapp' from 'c:\\...te-packages\\\\IPython\\\\kernel\\\\zmq\\\\ke\r\nrnelapp.py'>}, init_globals=None, mod_name='__main__', mod_spec=ModuleSpec(name='IPython.kernel.__main__', loade...ib\\\\s\r\nite-packages\\\\IPython\\\\kernel\\\\__main__.py'), pkg_name='IPython.kernel', script_name=None)\r\n     83                        __package__ = pkg_name,\r\n     84                        __spec__ = mod_spec)\r\n---> 85     exec(code, run_globals)\r\n        global exec = undefined\r\n        code = <code object <module> at 0x00000000025AC5D0, file \"c:\\Anaconda\\lib\\site-packages\\IPython\\kernel\\__main__.\r\npy\", line 1>\r\n        run_globals = {'__name__': '__main__', '__loader__': <_frozen_importlib.SourceFileLoader object at 0x0000000001F\r\n1D9B0>, '__package__': 'IPython.kernel', 'app': <module 'IPython.kernel.zmq.kernelapp' from 'c:\\\\Anaconda\\\\lib\\\\site-pac\r\nkages\\\\IPython\\\\kernel\\\\zmq\\\\kernelapp.py'>, '__spec__': ModuleSpec(name='IPython.kernel.__main__', loader=<_frozen_impo\r\nrtlib.SourceFileLoader object at 0x0000000001F1D9B0>, origin='c:\\\\Anaconda\\\\lib\\\\site-packages\\\\IPython\\\\kernel\\\\__main_\r\n_.py'), '__cached__': 'c:\\\\Anaconda\\\\lib\\\\site-packages\\\\IPython\\\\kernel\\\\__pycache__\\\\__main__.cpython-34.pyc', '__doc_\r\n_': None, '__file__': 'c:\\\\Anaconda\\\\lib\\\\site-packages\\\\IPython\\\\kernel\\\\__main__.py', '__builtins__': <module 'builtin\r\ns' (built-in)>}\r\n     86     return run_globals\r\n     87\r\n\r\nc:\\Anaconda\\lib\\site-packages\\IPython\\kernel\\__main__.py in <module>()\r\n      1 if __name__ == '__main__':\r\n      2     from IPython.kernel.zmq import kernelapp as app\r\n----> 3     app.launch_new_instance()\r\n        global app.launch_new_instance = <bound method MetaHasTraits.launch_instance of <class 'IPython.kernel.zmq.kerne\r\nlapp.IPKernelApp'>>\r\n\r\nc:\\Anaconda\\lib\\site-packages\\IPython\\config\\application.py in launch_instance(cls=<class 'IPython.kernel.zmq.kernelapp.\r\nIPKernelApp'>, argv=None, **kwargs={})\r\n    572         app = cls.instance(**kwargs)\r\n    573         app.initialize(argv)\r\n--> 574         app.start()\r\n        app.start = <bound method IPKernelApp.start of <IPython.kernel.zmq.kernelapp.IPKernelApp object at 0x00000000006\r\n27358>>\r\n    575\r\n    576 #-----------------------------------------------------------------------------\r\n\r\nc:\\Anaconda\\lib\\site-packages\\IPython\\kernel\\zmq\\kernelapp.py in start(self=<IPython.kernel.zmq.kernelapp.IPKernelApp ob\r\nject>)\r\n    372         self.kernel.start()\r\n    373         try:\r\n--> 374             ioloop.IOLoop.instance().start()\r\n        global ioloop.IOLoop.instance.start = undefined\r\n    375         except KeyboardInterrupt:\r\n    376             pass\r\n\r\nc:\\Anaconda\\lib\\site-packages\\zmq\\eventloop\\ioloop.py in start(self=<zmq.eventloop.ioloop.ZMQIOLoop object>)\r\n    149     def start(self):\r\n    150         try:\r\n--> 151             super(ZMQIOLoop, self).start()\r\n        global super = undefined\r\n        global ZMQIOLoop = <class 'zmq.eventloop.ioloop.ZMQIOLoop'>\r\n        self.start = <bound method ZMQIOLoop.start of <zmq.eventloop.ioloop.ZMQIOLoop object at 0x000000000471AB70>>\r\n    152         except ZMQError as e:\r\n    153             if e.errno == ETERM:\r\n\r\nc:\\Anaconda\\lib\\site-packages\\tornado\\ioloop.py in start(self=<zmq.eventloop.ioloop.ZMQIOLoop object>)\r\n    810\r\n    811                 try:\r\n--> 812                     event_pairs = self._impl.poll(poll_timeout)\r\n        event_pairs = [(<zmq.sugar.socket.Socket object at 0x00000000046691C8>, 4)]\r\n        self._impl.poll = <bound method ZMQPoller.poll of <zmq.eventloop.ioloop.ZMQPoller object at 0x000000000471ABA8>>\r\n\r\n        poll_timeout = 3600.0\r\n    813                 except Exception as e:\r\n    814                     # Depending on python version and IOLoop implementation,\r\n\r\nc:\\Anaconda\\lib\\site-packages\\zmq\\eventloop\\ioloop.py in poll(self=<zmq.eventloop.ioloop.ZMQPoller object>, timeout=3600\r\n.0)\r\n    120         Event masks will be IOLoop.READ/WRITE/ERROR\r\n    121         \"\"\"\r\n--> 122         z_events = self._poller.poll(1000*timeout)\r\n        z_events = undefined\r\n        self._poller.poll = <bound method Poller.poll of <zmq.sugar.poll.Poller object at 0x000000000471ABE0>>\r\n        timeout = 3600.0\r\n    123         return [ (fd,self._remap_events(evt)) for (fd,evt) in z_events ]\r\n    124\r\n\r\nc:\\Anaconda\\lib\\site-packages\\zmq\\sugar\\poll.py in poll(self=<zmq.sugar.poll.Poller object>, timeout=3600000)\r\n     99         elif isinstance(timeout, float):\r\n    100             timeout = int(timeout)\r\n--> 101         return zmq_poll(self.sockets, timeout=timeout)\r\n        global zmq_poll = <built-in function zmq_poll>\r\n        self.sockets = [(872, 5), (<zmq.sugar.socket.Socket object at 0x00000000046691C8>, 5), (<zmq.sugar.socket.Socket\r\n object at 0x00000000046FAAC8>, 5)]\r\n        timeout = 3600000\r\n    102\r\n    103\r\n\r\nTypeError: 'int' object is not callable\r\n[I 20:06:25.898 NotebookApp] KernelRestarter: restarting kernel (1/5)\r\nWARNING:root:kernel 393b742e-b876-4e59-9e74-21e79f9e5169 restarted\r\n``\r\n"},"comment":{"url":"https://api.github.com/repos/ipython/ipython/issues/comments/72932709","html_url":"https://github.com/ipython/ipython/issues/7685#issuecomment-72932709","issue_url":"https://api.github.com/repos/ipython/ipython/issues/7685","id":72932709,"user":{"login":"minrk","id":151929,"avatar_url":"https://avatars.githubusercontent.com/u/151929?v=3","gravatar_id":"","url":"https://api.github.com/users/minrk","html_url":"https://github.com/minrk","followers_url":"https://api.github.com/users/minrk/followers","following_url":"https://api.github.com/users/minrk/following{/other_user}","gists_url":"https://api.github.com/users/minrk/gists{/gist_id}","starred_url":"https://api.github.com/users/minrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minrk/subscriptions","organizations_url":"https://api.github.com/users/minrk/orgs","repos_url":"https://api.github.com/users/minrk/repos","events_url":"https://api.github.com/users/minrk/events{/privacy}","received_events_url":"https://api.github.com/users/minrk/received_events","type":"User","site_admin":false},"created_at":"2015-02-04T20:30:47Z","updated_at":"2015-02-04T20:30:47Z","body":"This appears to be a regression in pyzmq 14, so I'll be looking into it. It doesn't make a lot of sense, since the code where the wrong exception is being raised hasn't actually changed at all, but then again, nothing about how Windows handles signals has ever made any sense. For now, you can install `'pyzmq<14'` to avoid the error."}}