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:
Antoine Pitrou 2012-01-06 20:16:19 +01:00
parent deec7566ae
commit 0a08d7a095
5 changed files with 64 additions and 3 deletions

View file

@ -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)