mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
Fixes for notebook checkpoint APIs
This commit is contained in:
parent
3f46a05a14
commit
cbc141c95c
@ -394,7 +394,7 @@ class FileNotebookManager(NotebookManager):
|
||||
u'Notebook checkpoint does not exist: %s-%s' % (name, checkpoint_id)
|
||||
)
|
||||
# ensure notebook is readable (never restore from an unreadable notebook)
|
||||
with file(cp_path, 'r') as f:
|
||||
with open(cp_path, 'r') as f:
|
||||
nb = current.read(f, u'json')
|
||||
shutil.copy2(cp_path, nb_path)
|
||||
self.log.debug("copying %s -> %s", cp_path, nb_path)
|
||||
|
@ -197,6 +197,7 @@ class NotebookCheckpointsHandler(IPythonHandler):
|
||||
location = url_path_join(self.base_project_url, u'/api/notebooks',
|
||||
path, name, 'checkpoints', checkpoint[u'checkpoint_id'])
|
||||
self.set_header(u'Location', location)
|
||||
self.set_status(201)
|
||||
self.finish(data)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user