New submission from Florent Coriat: 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. ---------- components: Library (Lib) messages: 291499 nosy: noctiflore priority: normal severity: normal status: open title: shutil.copystat should (allow to) copy ownership, and other attributes type: enhancement versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30044> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com