8000 gh-101334: Don't force USTAR format in test_tarfile. (GH-101572) · python/cpython@6ae8032 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6ae8032

Browse files
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 ffcb822) Co-authored-by: Gregory P. Smith <greg@krypto.org>
1 parent cf89c16 commit 6ae8032

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Lib/test/test_tarfile.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,11 @@ def test_add_dir_getmember(self):
225225
self.add_dir_and_getmember('bar')
226226
self.add_dir_and_getmember('a'*101)
227227

228+
@unittest.skipIf(
229+
(hasattr(os, 'getuid') and os.getuid() > 0o777_7777) or
230+
(hasattr(os, 'getgid') and os.getgid() > 0o777_7777),
231+
"uid or gid too high for USTAR format."
232+
)
228233
def add_dir_and_getmember(self, name):
229234
with os_helper.temp_cwd():
230235
with tarfile.open(tmpname, 'w') as tar:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
``test_tarfile`` has been updated to pass when run as a high UID.

0 commit comments

Comments
 (0)
0