mirror of https://github.com/python/cpython
gh-101334: Don't force USTAR format in test_tarfile. (GH-101572)
That causes the test to fail when run using a high UID as that ancient format cannot represent it. The current default (PAX) and the old default (GNU) both support high UIDs.
This commit is contained in:
parent
f7e9fbacb2
commit
ffcb8220d7
|
@ -225,6 +225,11 @@ class UstarReadTest(ReadTest, unittest.TestCase):
|
||||||
self.add_dir_and_getmember('bar')
|
self.add_dir_and_getmember('bar')
|
||||||
self.add_dir_and_getmember('a'*101)
|
self.add_dir_and_getmember('a'*101)
|
||||||
|
|
||||||
|
@unittest.skipIf(
|
||||||
|
(hasattr(os, 'getuid') and os.getuid() > 0o777_7777) or
|
||||||
|
(hasattr(os, 'getgid') and os.getgid() > 0o777_7777),
|
||||||
|
"uid or gid too high for USTAR format."
|
||||||
|
)
|
||||||
def add_dir_and_getmember(self, name):
|
def add_dir_and_getmember(self, name):
|
||||||
with os_helper.temp_cwd():
|
with os_helper.temp_cwd():
|
||||||
with tarfile.open(tmpname, 'w') as tar:
|
with tarfile.open(tmpname, 'w') as tar:
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
``test_tarfile`` has been updated to pass when run as a high UID.
|
Loading…
Reference in New Issue