This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author noctiflore
Recipients noctiflore
Date 2017-04-11.15:42:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491925353.8.0.782070431072.issue30044@psf.upfronthosting.co.za>
In-reply-to
Content
shutil.copystat() copies permissions, timestamps and even flags and xattrs (if supported), but not ownership.
Furthermore, shutil.copy2() documentation until 2.7 used to say it behaves like cp -p, which preserves ownership, and not xattr nor flags. (On my system it silently fails to copy ownership when not root).

It may not be related, but comments in source code for the except NotImplementedError block concerning chmod mistakenly mentions chown-related functions.

I think copystat (and copy2) should at least provide an option to preserve ownership.
I do not know if it currently preserves SELinux context and ACL, but if not, it may also allow it.
It would be really useful for replication or backup applications to have a function that copies everything it can.
History
Date User Action Args
2017-04-11 15:42:33noctifloresetrecipients: + noctiflore
2017-04-11 15:42:33noctifloresetmessageid: <1491925353.8.0.782070431072.issue30044@psf.upfronthosting.co.za>
2017-04-11 15:42:33noctiflorelinkissue30044 messages
2017-04-11 15:42:33noctiflorecreate