Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ae4a78b

Browse files
committed
Fix closes issue12577 - clarify shutil.move documentation. Patch suggestion by Catalin Iacob
1 parent 0e752dd commit ae4a78b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Doc/library/shutil.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,10 @@ Directory and files operations
161161

162162
Recursively move a file or directory to another location.
163163

164-
If the destination is on the current filesystem, then simply use rename.
165-
Otherwise, copy src (with :func:`copy2`) to the dst and then remove src.
164+
Uses :func:`os.rename` to perform the move. If it fails, for reasons such as
165+
when *src* and *dst* are on different filesystems or in case of windows where
166+
rename is not supported when *dst* exists, fallback to copying *src* (with
167+
:func:`copy2`) to the *dst* and then remove *src*.
166168

167169

168170
.. exception:: Error

0 commit comments

Comments
 (0)