summaryrefslogtreecommitdiffstats
path: root/Lib/shutil.py
diff options
context:
space:
mode:
authorHynek Schlawack <hs@ox.cx>2013-02-05 07:25:24 (GMT)
committerHynek Schlawack <hs@ox.cx>2013-02-05 07:25:24 (GMT)
commit4cd7b9c3e942b8afdbd41df16837fc09b5fb8993 (patch)
tree96425a840b98cbd0ff1fa76378bafdabfae438f1 /Lib/shutil.py
parent1f0044c473e8fb10b3f7ec7624b08a9ee44e642f (diff)
parent0beab058dd431a7c0d62cfc50d8503616e01fd17 (diff)
downloadcpython-4cd7b9c3e942b8afdbd41df16837fc09b5fb8993.zip
cpython-4cd7b9c3e942b8afdbd41df16837fc09b5fb8993.tar.gz
cpython-4cd7b9c3e942b8afdbd41df16837fc09b5fb8993.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 0cc74f6..c2f0278 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -140,7 +140,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)