From fd3aee4fcbde21e71b3fff524ca1394e92156701 2014-12-17 19:38:45 From: Scott Sanderson Date: 2014-12-17 19:38:45 Subject: [PATCH] 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. --- diff --git a/IPython/html/services/contents/manager.py b/IPython/html/services/contents/manager.py index c618944..06edfcc 100644 --- a/IPython/html/services/contents/manager.py +++ b/IPython/html/services/contents/manager.py @@ -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: