bpo-24564: shutil.copystat(): ignore EINVAL on os.setxattr() (GH-13369)
This commit is contained in:
parent
8087831231
commit
a16387ab2d
|
@ -309,7 +309,7 @@ if hasattr(os, 'listxattr'):
|
|||
try:
|
||||
names = os.listxattr(src, follow_symlinks=follow_symlinks)
|
||||
except OSError as e:
|
||||
if e.errno not in (errno.ENOTSUP, errno.ENODATA):
|
||||
if e.errno not in (errno.ENOTSUP, errno.ENODATA, errno.EINVAL):
|
||||
raise
|
||||
return
|
||||
for name in names:
|
||||
|
@ -317,7 +317,8 @@ if hasattr(os, 'listxattr'):
|
|||
value = os.getxattr(src, name, follow_symlinks=follow_symlinks)
|
||||
os.setxattr(dst, name, value, follow_symlinks=follow_symlinks)
|
||||
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):
|
||||
raise
|
||||
else:
|
||||
def _copyxattr(*args, **kwargs):
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
: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.
|
Loading…
Reference in New Issue