diff --git a/IPython/html/services/notebooks/filenbmanager.py b/IPython/html/services/notebooks/filenbmanager.py index 908ad96..9d0a73c 100644 --- a/IPython/html/services/notebooks/filenbmanager.py +++ b/IPython/html/services/notebooks/filenbmanager.py @@ -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) diff --git a/IPython/html/services/notebooks/handlers.py b/IPython/html/services/notebooks/handlers.py index 540a233..37f6f3a 100644 --- a/IPython/html/services/notebooks/handlers.py +++ b/IPython/html/services/notebooks/handlers.py @@ -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)