cpython: 6bf168b55d07 (original) (raw)
Mercurial > cpython
changeset 71591:6bf168b55d07 2.7
Update documentation for shutil.move (#12043) and fix a few typos. Adding Sandro Tosi to Doc/ACKS for this patch and all his work on the docs mailing list and on the bug tracker. [#12043]
Éric Araujo merwok@netwok.org | |
---|---|
date | Fri, 29 Jul 2011 12:10:53 +0200 |
parents | 4e5127874adf |
children | 8b816bb2969b |
files | Doc/ACKS.txt Doc/library/shutil.rst |
diffstat | 2 files changed, 18 insertions(+), 10 deletions(-)[+] [-] Doc/ACKS.txt 1 Doc/library/shutil.rst 27 |
line wrap: on
line diff
--- a/Doc/ACKS.txt +++ b/Doc/ACKS.txt @@ -199,6 +199,7 @@ docs@python.org), and we'll be glad to c * Kalle Svensson * Jim Tittsler * David Turner
--- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -161,24 +161,31 @@ Directory and files operations .. function:: move(src, dst)
- 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.
- 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.
- 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 on the current filesystem, then :func:
os.rename
is - used. Otherwise, src is copied (using :func:
copy2
) to dst and then - removed. .. versionadded:: 2.3
- This exception collects exceptions that raised during a multi-file operation. For
- :func:
copytree
, the exception argument is a list of 3-tuples (srcname, - dstname, exception).
- This exception collects exceptions that are raised during a multi-file
- operation. For :func:
copytree
, the exception argument is a list of 3-tuples - (srcname, dstname, exception). .. versionadded:: 2.3
+ .. _shutil-example: copytree example @@ -277,7 +284,7 @@ Archives operations .. function:: get_archive_formats()
- Return a list of supported formats for archiving.
Each element of the returned sequence is a tuple
(name, description)
By default :mod:shutil
provides these formats: @@ -295,7 +302,7 @@ Archives operations
.. function:: register_archive_format(name, function, [extra_args, [description]])