From: Benjamin Peterson Date: Sun, 22 Mar 2015 14:11:54 +0000 (-0400) Subject: clarify behavior of shutil.move when destination exists (closes #22933) X-Git-Tag: v2.7.10rc1~113 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=29368584d295aed3ec198c158f6503f370492c03;p=thirdparty%2FPython%2Fcpython.git clarify behavior of shutil.move when destination exists (closes #22933) Patch by Mike Short. --- diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index e8974839acc8..f350f5ea5446 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -164,12 +164,9 @@ Directory and files operations 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