summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2023-02-05 17:44:57 (GMT)
committerGitHub <noreply@github.com>2023-02-05 17:44:57 (GMT)
commitffcb8220d7a8c8ca169b467d9e4a752874f68af2 (patch)
treed226232d5e58a091fadd2075f9cf9efcd7c82a10
parentf7e9fbacb250ad9df95d0024161b40dfdc9cc39e (diff)
downloadcpython-ffcb8220d7a8c8ca169b467d9e4a752874f68af2.zip
cpython-ffcb8220d7a8c8ca169b467d9e4a752874f68af2.tar.gz
cpython-ffcb8220d7a8c8ca169b467d9e4a752874f68af2.tar.bz2
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.
-rw-r--r--Lib/test/test_tarfile.py5
-rw-r--r--Misc/NEWS.d/next/Tests/2023-02-04-17-24-33.gh-issue-101334._yOqwg.rst1
2 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index 2139320..f15a800 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -225,6 +225,11 @@ class UstarReadTest(ReadTest, unittest.TestCase):
self.add_dir_and_getmember('bar')
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):
with os_helper.temp_cwd():
with tarfile.open(tmpname, 'w') as tar:
diff --git a/Misc/NEWS.d/next/Tests/2023-02-04-17-24-33.gh-issue-101334._yOqwg.rst b/Misc/NEWS.d/next/Tests/2023-02-04-17-24-33.gh-issue-101334._yOqwg.rst
new file mode 100644
index 0000000..2a95fd9
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2023-02-04-17-24-33.gh-issue-101334._yOqwg.rst
@@ -0,0 +1 @@
+``test_tarfile`` has been updated to pass when run as a high UID.