From: Senthil Kumaran Date: Tue, 19 Jul 2011 00:03:55 +0000 (+0800) Subject: merge from 3.2 - Fix closes issue12577 - clarify shutil.move documentation. Patch... X-Git-Tag: v3.3.0a1~1876 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a8713b141ab1d060bd0ba0c9e6aa93dd476bb224;p=thirdparty%2FPython%2Fcpython.git merge from 3.2 - Fix closes issue12577 - clarify shutil.move documentation. Patch suggestion by Catalin Iacob --- a8713b141ab1d060bd0ba0c9e6aa93dd476bb224 diff --cc Doc/library/shutil.rst index 88c0eaa8db02,1f194a0779ee..f8a1b60f6f33 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@@ -161,17 -161,11 +161,19 @@@ Directory and files operation Recursively move a file or directory to another location. - If the destination is on the current filesystem, then simply use rename. - Otherwise, copy src (with :func:`copy2`) to the dst and then remove src. + Uses :func:`os.rename` to perform the move. If it fails, for reasons such as + when *src* and *dst* are on different filesystems or in case of windows where + rename is not supported when *dst* exists, fallback to copying *src* (with + :func:`copy2`) to the *dst* and then remove *src*. +.. function:: disk_usage(path) + + Return disk usage statistics about the given path as a namedtuple including + total, used and free space expressed in bytes. + + .. versionadded:: 3.3 + + Availability: Unix, Windows. .. exception:: Error