##// END OF EJS Templates
404 on attempt to list notebooks in nonexistant directory
Thomas Kluyver -
Show More
@@ -76,6 +76,8 b' class FileNotebookManager(NotebookManager):'
76 def get_notebook_names(self, path=''):
76 def get_notebook_names(self, path=''):
77 """List all notebook names in the notebook dir and path."""
77 """List all notebook names in the notebook dir and path."""
78 path = path.strip('/')
78 path = path.strip('/')
79 if not os.path.isdir(self.get_os_path(path=path)):
80 raise web.HTTPError(404, 'Directory not found: ' + path)
79 names = glob.glob(self.get_os_path('*'+self.filename_ext, path))
81 names = glob.glob(self.get_os_path('*'+self.filename_ext, path))
80 names = [os.path.basename(name)
82 names = [os.path.basename(name)
81 for name in names]
83 for name in names]
General Comments 0
You need to be logged in to leave comments. Login now