diff options
author | Hynek Schlawack <hs@ox.cx> | 2013-02-05 07:25:24 (GMT) |
---|---|---|
committer | Hynek Schlawack <hs@ox.cx> | 2013-02-05 07:25:24 (GMT) |
commit | 4cd7b9c3e942b8afdbd41df16837fc09b5fb8993 (patch) | |
tree | 96425a840b98cbd0ff1fa76378bafdabfae438f1 /Lib/shutil.py | |
parent | 1f0044c473e8fb10b3f7ec7624b08a9ee44e642f (diff) | |
parent | 0beab058dd431a7c0d62cfc50d8503616e01fd17 (diff) | |
download | cpython-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.py | 8 |
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) |