summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Borgström <jonas@borgstrom.se>2013-08-05 20:38:37 +0200
committerJonas Borgström <jonas@borgstrom.se>2013-08-05 20:38:37 +0200
commit7815ed5885ce232e68452b04a3c252836b3cada9 (patch)
treea20adc91d6f0f07c9a6baaeef4c6ac5d2b9bccc8
parenta51a10a96cbaf39b29475d574d2cb0df7f35a11e (diff)
Fix xattr issue on OS X.
-rw-r--r--attic/testsuite/archiver.py2
-rw-r--r--attic/xattr.py7
2 files changed, 7 insertions, 2 deletions
diff --git a/attic/testsuite/archiver.py b/attic/testsuite/archiver.py
index ec3d5857c..876cb1d6a 100644
--- a/attic/testsuite/archiver.py
+++ b/attic/testsuite/archiver.py
@@ -206,7 +206,7 @@ class ArchiverTestCase(AtticTestCase):
name = sorted(os.listdir(os.path.join(self.tmpdir, 'repository', 'data', '0')), reverse=True)[0]
fd = open(os.path.join(self.tmpdir, 'repository', 'data', '0', name), 'r+')
fd.seek(100)
- fd.write('X')
+ fd.write('XXXX')
fd.close()
self.attic('verify', self.repository_location + '::test', exit_code=1)
diff --git a/attic/xattr.py b/attic/xattr.py
index df49b46a8..e3e2d9aeb 100644
--- a/attic/xattr.py
+++ b/attic/xattr.py
@@ -124,7 +124,12 @@ except ImportError:
func = libc.flistxattr
elif not follow_symlinks:
flags = XATTR_NOFOLLOW
- n = _check(func(path, None, 0, flags), path)
+ try:
+ n = _check(func(path, None, 0, flags), path)
+ except OSError as e:
+ if e.errno == errno.EPERM:
+ return []
+ raise
if n == 0:
return []
namebuf = create_string_buffer(n)