summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-02-05 19:46:50 (GMT)
committerGitHub <noreply@github.com>2023-02-05 19:46:50 (GMT)
commit435fcb07e5e7caea4253e39e1e2de80e58be8ea2 (patch)
tree8edd5a9c3d2da1481a95d13b3099b1518de9dd1f /Lib/test
parentb134978467409eb1a7ed0d5ca4a656fab1927919 (diff)
downloadcpython-435fcb07e5e7caea4253e39e1e2de80e58be8ea2.zip
cpython-435fcb07e5e7caea4253e39e1e2de80e58be8ea2.tar.gz
cpython-435fcb07e5e7caea4253e39e1e2de80e58be8ea2.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. (cherry picked from commit ffcb8220d7a8c8ca169b467d9e4a752874f68af2) Co-authored-by: Gregory P. Smith <greg@krypto.org>
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_tarfile.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index c658cca..cba95e9 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: