We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd577df commit 4edb1e0Copy full SHA for 4edb1e0
1 file changed
fs/move.py
@@ -10,7 +10,7 @@
10
from . import open_fs
11
from .copy import copy_dir
12
from .copy import copy_file
13
-from .errors import ResourceReadOnly
+from .errors import FSError, ResourceReadOnly
14
from .opener import manage_fs
15
from .path import frombase
16
@@ -103,7 +103,13 @@ def move_file(
103
dst_path,
104
preserve_time=preserve_time,
105
)
106
- _src_fs.remove(src_path)
+ try:
107
+ _src_fs.remove(src_path)
108
+ except FSError as e:
109
+ # if the source cannot be removed we delete the copy on the
110
+ # destination
111
+ _dst_fs.remove(dst_path)
112
+ raise e
113
114
115
def move_dir(
0 commit comments