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

Skip to content

Commit 7b41dba

Browse files
Marcel Plchencukou
authored andcommitted
bpo-34325: Skip zipfile test for large timestamps when filesystem don't support them. (GH-8656)
When the filesystem doesn't support files with large timestamps, skip testing that such files can be zipped.
1 parent caba55b commit 7b41dba

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Lib/test/test_zipfile.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,11 @@ def test_add_file_before_1980(self):
556556

557557
def test_add_file_after_2107(self):
558558
# Set atime and mtime to 2108-12-30
559-
os.utime(TESTFN, (4386268800, 4386268800))
559+
try:
560+
os.utime(TESTFN, (4386268800, 4386268800))
561+
except OverflowError:
562+
self.skipTest('Host fs cannot set timestamp to required value.')
563+
560564
with zipfile.ZipFile(TESTFN2, "w") as zipfp:
561565
self.assertRaises(struct.error, zipfp.write, TESTFN)
562566

0 commit comments

Comments
 (0)