bpo-29181: Skip test_tarfile tests on PermissionError raised by Android (GH-4375)

This commit is contained in:
xdegaye 2017-11-12 18:02:06 +01:00 committed by GitHub
parent 6a55d09573
commit d7d4fea4a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -1147,7 +1147,10 @@ class WriteTest(WriteTestBase, unittest.TestCase):
target = os.path.join(TEMPDIR, "link_target")
with open(target, "wb") as fobj:
fobj.write(b"aaa")
os.link(target, link)
try:
os.link(target, link)
except PermissionError as e:
self.skipTest('os.link(): %s' % e)
try:
tar = tarfile.open(tmpname, self.mode)
try:
@ -1609,7 +1612,10 @@ class HardlinkTest(unittest.TestCase):
with open(self.foo, "wb") as fobj:
fobj.write(b"foo")
os.link(self.foo, self.bar)
try:
os.link(self.foo, self.bar)
except PermissionError as e:
self.skipTest('os.link(): %s' % e)
self.tar = tarfile.open(tmpname, "w")
self.tar.add(self.foo)