-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
bpo-24538: Fix bug in shutil involving the copying of xattrs to read-only files. #13212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for your contribution, we look forward to reviewing it! |
…only files. Extended attributes can only be set on user-writeable files, but shutil previously first chmod()ed the destination file to the source's permissions and then tried to copy xattrs. This will cause failures if attempting to copy read-only files with xattrs, as occurs with Git clones on Lustre FS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This also needs a backport for 3.7 and 2.7. Also se my comment at https://bugs.python.org/issue24538#msg342051
Thanks @obilaniu for the PR, and @giampaolo for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7. |
Thanks @obilaniu for the PR, and @giampaolo for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Thanks @obilaniu for the PR, and @giampaolo for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7. |
Sorry, @obilaniu and @giampaolo, I could not cleanly backport this to |
May I call for a backport to 3.5 & 3.6 as well? They are often used in my field as well. The backport to 3.7 “failed” (#13234), but only because of a flaky test. Can we ignore it? |
@obilaniu 3.6 and 3.5 branches accept security patches only: |
@obilaniu could you please create a PR for 2.7 branch as well? |
@giampaolo Oh ok, then I think 3.7 is plenty good enough. I looked at Python 2.7 and it looks unaffected by the problem. The failing codepaths related to copying xattrs are absent in Python 2, and indeed things like |
Implements solution recommend in https://bugs.python.org/issue24538#msg301493
https://bugs.python.org/issue24538