[Python-checkins] cpython (2.7): clarify behavior of shutil.move when destination exists (closes #22933)

benjamin.peterson python-checkins at python.org
Sun Mar 22 15:15:16 CET 2015


https://hg.python.org/cpython/rev/4502e598fe26
changeset:   95124:4502e598fe26
branch:      2.7
parent:      95118:aa79a04e9bf5
user:        Benjamin Peterson <benjamin at python.org>
date:        Sun Mar 22 10:11:54 2015 -0400
summary:
  clarify behavior of shutil.move when destination exists (closes #22933)

Patch by Mike Short.

files:
  Doc/library/shutil.rst |  9 +++------
  1 files changed, 3 insertions(+), 6 deletions(-)


diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst
--- a/Doc/library/shutil.rst
+++ b/Doc/library/shutil.rst
@@ -164,12 +164,9 @@
 
    Recursively move a file or directory (*src*) to another location (*dst*).
 
-   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

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list