bpo-24564: shutil.copystat(): ignore EINVAL on os.setxattr() (GH-13369)
(cherry picked from commit a16387ab2d85f19665920bb6ff91a7e57f59dd2a)
Co-authored-by: Ying Wang <me@yingw787.com>
diff --git a/Lib/shutil.py b/Lib/shutil.py
index 4c6fdd7..fc6fb4e 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -156,7 +156,7 @@
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:
@@ -164,7 +164,8 @@
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):