mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
404 on attempt to list notebooks in nonexistant directory
This commit is contained in:
parent
18f88d020f
commit
b1a0f2e8cc
@ -76,6 +76,8 @@ class FileNotebookManager(NotebookManager):
|
||||
def get_notebook_names(self, path=''):
|
||||
"""List all notebook names in the notebook dir and path."""
|
||||
path = path.strip('/')
|
||||
if not os.path.isdir(self.get_os_path(path=path)):
|
||||
raise web.HTTPError(404, 'Directory not found: ' + path)
|
||||
names = glob.glob(self.get_os_path('*'+self.filename_ext, path))
|
||||
names = [os.path.basename(name)
|
||||
for name in names]
|
||||
|
Loading…
Reference in New Issue
Block a user