##// END OF EJS Templates
FileNotebookManager: Use shutil.move() instead of os.rename()...
Pankaj Pandey -
Show More
@@ -387,7 +387,7 b' class FileNotebookManager(NotebookManager):'
387
387
388 # Move the notebook file
388 # Move the notebook file
389 try:
389 try:
390 os.rename(old_os_path, new_os_path)
390 shutil.move(old_os_path, new_os_path)
391 except Exception as e:
391 except Exception as e:
392 raise web.HTTPError(500, u'Unknown error renaming notebook: %s %s' % (old_os_path, e))
392 raise web.HTTPError(500, u'Unknown error renaming notebook: %s %s' % (old_os_path, e))
393
393
@@ -399,11 +399,11 b' class FileNotebookManager(NotebookManager):'
399 new_cp_path = self.get_checkpoint_path(checkpoint_id, new_name, new_path)
399 new_cp_path = self.get_checkpoint_path(checkpoint_id, new_name, new_path)
400 if os.path.isfile(old_cp_path):
400 if os.path.isfile(old_cp_path):
401 self.log.debug("Renaming checkpoint %s -> %s", old_cp_path, new_cp_path)
401 self.log.debug("Renaming checkpoint %s -> %s", old_cp_path, new_cp_path)
402 os.rename(old_cp_path, new_cp_path)
402 shutil.move(old_cp_path, new_cp_path)
403
403
404 # Move the .py script
404 # Move the .py script
405 if self.save_script:
405 if self.save_script:
406 os.rename(old_py_path, new_py_path)
406 shutil.move(old_py_path, new_py_path)
407
407
408 # Checkpoint-related utilities
408 # Checkpoint-related utilities
409
409
General Comments 0
You need to be logged in to leave comments. Login now