Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ffcb822

Browse files
authored
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.
1 parent f7e9fba commit ffcb822

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Lib/test/test_tarfile.py

+5
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:
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)