Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not crash on kernel shutdow if json file is missing #2098

Closed
fperez opened this issue Jul 5, 2012 · 1 comment
Closed

Do not crash on kernel shutdow if json file is missing #2098

fperez opened this issue Jul 5, 2012 · 1 comment
Labels
Milestone

Comments

@fperez
Copy link
Member

fperez commented Jul 5, 2012

I accidentally deleted my json connection file, but on shutdown IPython gave a crash message:

[NotebookApp] Shutting down kernels
Traceback (most recent call last):
  File "/home/fperez/usr/bin/ipython", line 7, in <module>
    launch_new_instance()
  File "/home/fperez/usr/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.py", line 389, in launch_new_instance
    app.start()
  File "/home/fperez/usr/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.py", line 359, in start
    return self.subapp.start()
  File "/home/fperez/usr/lib/python2.7/site-packages/IPython/frontend/html/notebook/notebookapp.py", line 581, in start
    self.cleanup_kernels()
  File "/home/fperez/usr/lib/python2.7/site-packages/IPython/frontend/html/notebook/notebookapp.py", line 544, in cleanup_kernels
    km.shutdown_kernel(kid)
  File "/home/fperez/usr/lib/python2.7/site-packages/IPython/frontend/html/notebook/kernelmanager.py", line 285, in shutdown_kernel
    super(MappingKernelManager, self).shutdown_kernel(kernel_id)
  File "/home/fperez/usr/lib/python2.7/site-packages/IPython/frontend/html/notebook/kernelmanager.py", line 103, in shutdown_kernel
    self.get_kernel(kernel_id).shutdown_kernel()
  File "/home/fperez/usr/lib/python2.7/site-packages/IPython/zmq/kernelmanager.py", line 839, in shutdown_kernel
    os.remove(self.connection_file)
OSError: [Errno 2] No such file or directory: '/home/fperez/.ipython/profile_default/security/kernel-570bd1e9-c2c0-4236-b3f5-c2cbacc5713b.json'

We should protect that os.remove call with a try/except and just print a warning if it's not there, but not crash.

@minrk
Copy link
Member

minrk commented Jan 19, 2013

I believe this is fixed in master now.

@minrk minrk closed this as completed Jan 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants