Add same_file check in rename_file

pull/1142/head
Safia Abdalla 10 years ago
parent 3f4a2cb00b
commit 7a8aa92b73

@ -25,6 +25,7 @@ from . import tz
from notebook.utils import (
is_hidden,
to_api_path,
same_file,
)
_script_exporter = None
@ -460,7 +461,7 @@ class FileContentsManager(FileManagerMixin, ContentsManager):
old_os_path = self._get_os_path(old_path)
# Should we proceed with the move?
if os.path.exists(new_os_path):
if os.path.exists(new_os_path) and not same_file(old_os_path, new_os_path):
raise web.HTTPError(409, u'File already exists: %s' % new_path)
# Move the file

Loading…
Cancel
Save