bpo-24564: shutil.copystat(): ignore EINVAL on os.setxattr()#13369
bpo-24564: shutil.copystat(): ignore EINVAL on os.setxattr()#13369giampaolo merged 5 commits intopython:masterfrom
Conversation
…n setting extended attributes using os.setxattr().
| @@ -0,0 +1,3 @@ | |||
| shutil.copystat(): ignore EINVAL on os.setxattr() which may occur when copying files on NFS filesystems. | |||
There was a problem hiding this comment.
Do you mind adding markup and reword the NEWs entry? I think something like that could be good (think to use blurb to format correctly the lines):
:func:`shutil.copystat` now ignores :const:`errno.EINVAL` on :func:`os.setxattr` which may occur when copying files on filesystems without extended attributes support. Original patch by Giampaolo Rodola, updated by Ying Wang.
There was a problem hiding this comment.
Sounds great, should be pushed 👍
Lib/shutil.py
Outdated
| except OSError as e: | ||
| if e.errno not in (errno.EPERM, errno.ENOTSUP, errno.ENODATA): | ||
| if e.errno not in (errno.EPERM, | ||
| errno.ENOTSUP, errno.ENODATA, errno.EINVAL): |
There was a problem hiding this comment.
just a cosmetic/style nitpick - it's better to do this:
if e.errno not in (errno.EPERM, errno.ENOTSUP, errno.ENODATA,
errno.EINVAL):
There was a problem hiding this comment.
Should be updated!
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
Thanks @yingw787 for the PR, and @giampaolo for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
|
Thanks @yingw787 for the PR, and @giampaolo for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7. |
|
GH-13673 is a backport of this pull request to the 3.7 branch. |
|
Sorry, @yingw787 and @giampaolo, I could not cleanly backport this to |
[First-time contribution]
Carbon copy of PR #8601, except using tuples instead of sets. New pull request needed because original repo fork no longer exists.
This pull request ignores errno.EINVAL (invalid argument) when copying over extended attributes, which may cause copy to fail when copying files from a filesystem that supports extended attributes to filesystem that does not support extended attributes.
This pull request may also address bpo-36850.
CC: @giampaolo @serhiy-storchaka @abadger
https://bugs.python.org/issue24564