diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-03-22 14:11:54 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-03-22 14:11:54 (GMT) |
commit | 218144a94d54e5219a1d63fd07775a41059afcd6 (patch) | |
tree | a272e710d54fe86c3be5fafbb8c53c6c2bc626d1 /Doc/library/shutil.rst | |
parent | ce8f5ded651eb934e7aa31391b6459bce4c56edc (diff) | |
download | cpython-218144a94d54e5219a1d63fd07775a41059afcd6.zip cpython-218144a94d54e5219a1d63fd07775a41059afcd6.tar.gz cpython-218144a94d54e5219a1d63fd07775a41059afcd6.tar.bz2 |
clarify behavior of shutil.move when destination exists (closes #22933)
Patch by Mike Short.
Diffstat (limited to 'Doc/library/shutil.rst')
-rw-r--r-- | Doc/library/shutil.rst | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index d96fd71..cd86e92 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -287,12 +287,9 @@ Directory and files operations Recursively move a file or directory (*src*) to another location (*dst*) and return the destination. - If the destination is a directory or a symlink to a directory, then *src* is - moved inside that directory. - - The destination directory must not already exist. If the destination already - exists but is not a directory, it may be overwritten depending on - :func:`os.rename` semantics. + If the destination is an existing directory, then *src* is moved inside that + directory. If the destination already exists but is not a directory, it may + be overwritten depending on :func:`os.rename` semantics. If the destination is on the current filesystem, then :func:`os.rename` is used. Otherwise, *src* is copied (using :func:`shutil.copy2`) to *dst* and |