mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
Issue #9993: When the source and destination are on different filesystems,
and the source is a symlink, shutil.move() now recreates a symlink on the destination instead of copying the file contents. Patch by Jonathan Niehof and Hynek Schlawack.
This commit is contained in:
parent
deec7566ae
commit
0a08d7a095
5 changed files with 64 additions and 3 deletions
|
@ -196,7 +196,12 @@ Directory and files operations
|
|||
|
||||
If the destination is on the current filesystem, then :func:`os.rename` is
|
||||
used. Otherwise, *src* is copied (using :func:`copy2`) to *dst* and then
|
||||
removed.
|
||||
removed. In case of symlinks, a new symlink pointing to the target of *src*
|
||||
will be created in or as *dst* and *src* will be removed.
|
||||
|
||||
.. versionchanged:: 3.3
|
||||
Added explicit symlink handling for foreign filesystems, thus adapting
|
||||
it to the behavior of GNU's :program:`mv`.
|
||||
|
||||
.. function:: disk_usage(path)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue