mirror of
https://github.com/python/cpython.git
synced 2025-08-29 05:05:03 +00:00
bpo-24564: shutil.copystat(): ignore EINVAL on os.setxattr() (GH-13369)
This commit is contained in:
parent
8087831231
commit
a16387ab2d
2 changed files with 6 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue