Skip to content

Commit 63a2709

Browse files
gh-154325: Skip test_add_file_after_2107() if the file system rejects the timestamp (GH-154328)
Some file systems (UFS and ZFS on illumos) reject timestamps that do not fit in 32 bits with EOVERFLOW instead of raising OverflowError. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 70f7c6c commit 63a2709

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Lib/test/test_zipfile/test_core.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import _pyio
22
import array
33
import contextlib
4+
import errno
45
import importlib.util
56
import io
67
import itertools
@@ -655,6 +656,12 @@ def test_add_file_after_2107(self):
655656
os.utime(TESTFN, (ts, ts))
656657
except OverflowError:
657658
self.skipTest('Host fs cannot set timestamp to required value.')
659+
except OSError as exc:
660+
# Some file systems (e.g. UFS and ZFS on illumos) do not
661+
# support timestamps that do not fit in 32 bits.
662+
if exc.errno != errno.EOVERFLOW:
663+
raise
664+
self.skipTest('Host fs cannot set timestamp to required value.')
658665

659666
mtime_ns = os.stat(TESTFN).st_mtime_ns
660667
if mtime_ns != (4386268800 * 10**9):

0 commit comments

Comments
 (0)