_copyxattr: ignore EOPNOTSUPP from os.listxattr()
authorZac Medico <zmedico@gentoo.org>
Sun, 15 Sep 2013 09:36:12 +0000 (02:36 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 15 Sep 2013 09:36:12 +0000 (02:36 -0700)
This will fix bug #484540.

pym/portage/util/movefile.py

index 8ce80f1aa005c7877af9c1f1ea54d358b4bea793..e9b01be2269710430d6ffcb25818a2a608f59495 100644 (file)
@@ -72,7 +72,12 @@ if hasattr(_os, "getxattr"):
        # Python >=3.3 and GNU/Linux
        def _copyxattr(src, dest, exclude=None):
 
-               attrs = _os.listxattr(src)
+               try:
+                       attrs = _os.listxattr(src)
+               except OSError as e:
+                       if e.errno != OperationNotSupported.errno:
+                               raise
+                       attrs = ()
                if attrs:
                        if exclude is not None and isinstance(attrs[0], bytes):
                                exclude = exclude.encode(_encodings['fs'])