From adcb7025cab9ddb73fb54b40be7d50dd67311983 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Sun, 16 Dec 2018 21:06:55 +0100 Subject: [PATCH] Make filename check in list_running_servers more specific Closes gh-4283 --- notebook/notebookapp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index c180bea4d..05e44cf29 100755 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -1839,7 +1839,7 @@ def list_running_servers(runtime_dir=None): return for file_name in os.listdir(runtime_dir): - if file_name.startswith('nbserver-'): + if re.match('nbserver-(.+).json', file_name): with io.open(os.path.join(runtime_dir, file_name), encoding='utf-8') as f: info = json.load(f)