mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-05 12:19:58 +08:00
BUG: Sanitize to_path in ContentsManager.copy.
Without this, one of the test cases in `test_copy` attempts a copy to a directory that starts with a leading double-slash.
This commit is contained in:
parent
7ab1bf7487
commit
44805b94db
@ -347,6 +347,9 @@ class ContentsManager(LoggingConfigurable):
|
||||
from_path must be a full path to a file.
|
||||
"""
|
||||
path = from_path.strip('/')
|
||||
if to_path is not None:
|
||||
to_path = to_path.strip('/')
|
||||
|
||||
if '/' in path:
|
||||
from_dir, from_name = path.rsplit('/', 1)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user