summaryrefslogtreecommitdiffstats
path: root/Lib/shutil.py
diff options
context:
space:
mode:
authorHynek Schlawack <hs@ox.cx>2013-02-05 07:22:44 (GMT)
committerHynek Schlawack <hs@ox.cx>2013-02-05 07:22:44 (GMT)
commit0beab058dd431a7c0d62cfc50d8503616e01fd17 (patch)
tree6c8e1f435c931c2bc8edd7127cb72c4529e9ab7b /Lib/shutil.py
parent844b0e69717bf97bd7fbd055368ac398b99ec7e1 (diff)
downloadcpython-0beab058dd431a7c0d62cfc50d8503616e01fd17.zip
cpython-0beab058dd431a7c0d62cfc50d8503616e01fd17.tar.gz
cpython-0beab058dd431a7c0d62cfc50d8503616e01fd17.tar.bz2
#17076: Make copying of xattrs more permissive of missing FS support
Patch by Thomas Wouters.
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r--Lib/shutil.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py
index e4b640c..a188408 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -142,7 +142,13 @@ if hasattr(os, 'listxattr'):
"""
- for name in os.listxattr(src, follow_symlinks=follow_symlinks):
+ try:
+ names = os.listxattr(src, follow_symlinks=follow_symlinks)
+ except OSError as e:
+ if e.errno not in (errno.ENOTSUP, errno.ENODATA):
+ raise
+ return
+ for name in names:
try:
value = os.getxattr(src, name, follow_symlinks=follow_symlinks)
os.setxattr(dst, name, value, follow_symlinks=follow_symlinks)