##// END OF EJS Templates
Fixes for notebook checkpoint APIs
Thomas Kluyver -
Show More
@@ -394,7 +394,7 b' class FileNotebookManager(NotebookManager):'
394 u'Notebook checkpoint does not exist: %s-%s' % (name, checkpoint_id)
394 u'Notebook checkpoint does not exist: %s-%s' % (name, checkpoint_id)
395 )
395 )
396 # ensure notebook is readable (never restore from an unreadable notebook)
396 # ensure notebook is readable (never restore from an unreadable notebook)
397 with file(cp_path, 'r') as f:
397 with open(cp_path, 'r') as f:
398 nb = current.read(f, u'json')
398 nb = current.read(f, u'json')
399 shutil.copy2(cp_path, nb_path)
399 shutil.copy2(cp_path, nb_path)
400 self.log.debug("copying %s -> %s", cp_path, nb_path)
400 self.log.debug("copying %s -> %s", cp_path, nb_path)
@@ -197,6 +197,7 b' class NotebookCheckpointsHandler(IPythonHandler):'
197 location = url_path_join(self.base_project_url, u'/api/notebooks',
197 location = url_path_join(self.base_project_url, u'/api/notebooks',
198 path, name, 'checkpoints', checkpoint[u'checkpoint_id'])
198 path, name, 'checkpoints', checkpoint[u'checkpoint_id'])
199 self.set_header(u'Location', location)
199 self.set_header(u'Location', location)
200 self.set_status(201)
200 self.finish(data)
201 self.finish(data)
201
202
202
203
General Comments 0
You need to be logged in to leave comments. Login now