diff options
author | Zsolt Cserna <cserna.zsolt@gmail.com> | 2018-10-24 23:22:27 +0200 |
---|---|---|
committer | Victor Stinner <vstinner@redhat.com> | 2018-10-24 23:22:27 +0200 |
commit | 4a59c9699ca8688359c460f98127a12e2db6e63b (patch) | |
tree | 43e7a10b039eb555917e870a0d55ce5d6e0fce2f /Doc | |
parent | a1f45ec73f0486b187633e7ebc0a4f559d29d7d9 (diff) | |
download | cpython-git-4a59c9699ca8688359c460f98127a12e2db6e63b.tar.gz |
[2.7] bpo-34260, shutil: fix copy2 and copystat documentation (GH-8523) (GH-10071)
Fix the documentation of copy2, as it does not copy file ownership (user and
group), only mode, mtime, atime and flags.
The original text was confusing to developers as it suggested that this
command is the same as 'cp -p', but according to cp(1), '-p' copies file
ownership as well.
Clarify which metadata is copied by shutil.copystat in its docstring.
(cherry picked from commit 4f399be0e70d8b5516b6213568b7665765bb3114)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/shutil.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index 6bd8f0585d..7e9af1ad5a 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -82,9 +82,11 @@ Directory and files operations .. function:: copy2(src, dst) - Similar to :func:`shutil.copy`, but metadata is copied as well -- in fact, - this is just :func:`shutil.copy` followed by :func:`copystat`. This is - similar to the Unix command :program:`cp -p`. + Identical to :func:`~shutil.copy` except that :func:`copy2` + also attempts to preserve file metadata. + + :func:`copy2` uses :func:`copystat` to copy the file metadata. + Please see :func:`copystat` for more information. .. function:: ignore_patterns(\*patterns) |