mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
[3.12] gh-113803: Fix inaccurate documentation for shutil.move when dst is an existing directory (GH-113837) (#115006)
* fix the usage of dst and destination in shutil.move doc
* update shutil.move doc
(cherry picked from commit da8f9fb2ea
)
Co-authored-by: Dai Wentao <dwt136@gmail.com>
This commit is contained in:
parent
b9937a6f22
commit
5d2e30958a
2 changed files with 19 additions and 16 deletions
|
@ -846,12 +846,12 @@ def move(src, dst, copy_function=copy2):
|
|||
similar to the Unix "mv" command. Return the file or directory's
|
||||
destination.
|
||||
|
||||
If the destination is a directory or a symlink to a directory, the source
|
||||
is moved inside the directory. The destination path must not already
|
||||
exist.
|
||||
If dst is an existing directory or a symlink to a directory, then src is
|
||||
moved inside that directory. The destination path in that directory must
|
||||
not already exist.
|
||||
|
||||
If the destination already exists but is not a directory, it may be
|
||||
overwritten depending on os.rename() semantics.
|
||||
If dst already exists but is not a directory, it may be overwritten
|
||||
depending on os.rename() semantics.
|
||||
|
||||
If the destination is on our current filesystem, then rename() is used.
|
||||
Otherwise, src is copied to the destination and then removed. Symlinks are
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue