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:
Scott Sanderson 2014-12-14 23:41:57 -05:00 committed by Min RK
parent 7ab1bf7487
commit 44805b94db

View File

@ -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: