Fixes for notebook checkpoint APIs

This commit is contained in:
Thomas Kluyver 2013-10-10 15:02:35 -07:00 committed by MinRK
parent 3f46a05a14
commit cbc141c95c
2 changed files with 2 additions and 1 deletions

View File

@ -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)

View File

@ -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)