From 0beab058dd431a7c0d62cfc50d8503616e01fd17 Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Tue, 5 Feb 2013 08:22:44 +0100 Subject: #17076: Make copying of xattrs more permissive of missing FS support Patch by Thomas Wouters. --- Lib/shutil.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Lib/shutil.py') diff --git a/Lib/shutil.py b/Lib/shutil.py index e4b640cd17..a188408308 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) -- cgit v1.2.1