From 72a7c0bae5f61fb33eeb25f64e5f2c90f1e7189b Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 5 Jul 2016 17:20:23 +0200 Subject: [PATCH] catch "invalid argument" on cygwin, fixes #257 obviously cygwin (windows) does not like the made-up uid 100 gid 200 and raises "invalid argument" OSError. --- borg/testsuite/archiver.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/borg/testsuite/archiver.py b/borg/testsuite/archiver.py index 126d1c5a5..59bbeb2b8 100644 --- a/borg/testsuite/archiver.py +++ b/borg/testsuite/archiver.py @@ -288,10 +288,14 @@ def create_test_files(self): # File mode os.chmod('input/dir2', 0o555) # if we take away write perms, we need root to remove contents # File owner - os.chown('input/file1', 100, 200) + os.chown('input/file1', 100, 200) # raises OSError invalid argument on cygwin have_root = True # we have (fake)root except PermissionError: have_root = False + except OSError as e: + if e.errno != errno.EINVAL: + raise + have_root = False return have_root def test_basic_functionality(self):