diff options
author | Ying Wang <me@yingw787.com> | 2019-05-30 03:25:31 (GMT) |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2019-05-30 03:25:31 (GMT) |
commit | a16387ab2d85f19665920bb6ff91a7e57f59dd2a (patch) | |
tree | 9fad8608f044c7e3b4a8b83be21118288343bfc2 /Lib | |
parent | 80878312316bfb4011157f13cf040f6d885f808b (diff) | |
download | cpython-a16387ab2d85f19665920bb6ff91a7e57f59dd2a.zip cpython-a16387ab2d85f19665920bb6ff91a7e57f59dd2a.tar.gz cpython-a16387ab2d85f19665920bb6ff91a7e57f59dd2a.tar.bz2 |
bpo-24564: shutil.copystat(): ignore EINVAL on os.setxattr() (GH-13369)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/shutil.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py index b2e8f5f..2dfae87 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -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): |