Skip to content

Commit bdfc774

Browse files
committed
fix deletion when moving file on itself
1 parent 17575ba commit bdfc774

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/move.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ def move_file(
6464
with manage_fs(src_fs, writeable=True) as _src_fs:
6565
with manage_fs(dst_fs, writeable=True, create=True) as _dst_fs:
6666
if _src_fs is _dst_fs:
67+
if src_path == dst_path:
68+
return
69+
6770
# Same filesystem, may be optimized
6871
_src_fs.move(
6972
src_path, dst_path, overwrite=True, preserve_time=preserve_time

0 commit comments

Comments
 (0)