From 11f089aedb0704b3e272a2baef162ddc62d9c08f Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Sat, 6 Dec 2014 14:24:21 -0800 Subject: [PATCH] Handle nbserver info files without pid, from IPython 2.x Fixes takluyver/nbopen#9 --- IPython/html/notebookapp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IPython/html/notebookapp.py b/IPython/html/notebookapp.py index 24d18e89f..d69b27411 100644 --- a/IPython/html/notebookapp.py +++ b/IPython/html/notebookapp.py @@ -1025,7 +1025,8 @@ def list_running_servers(profile='default'): info = json.load(f) # Simple check whether that process is really still running - if check_pid(info['pid']): + # Also remove leftover files from IPython 2.x without a pid field + if ('pid' in info) and check_pid(info['pid']): yield info else: # If the process has died, try to delete its info file