Skip to content

Commit 4f55c53

Browse files
miss-islingtonserhiy-storchakaclaude
authored
[3.15] gh-154325: Skip test_add_file_after_2107() if the file system rejects the timestamp (GH-154328) (GH-154331)
Some file systems (UFS and ZFS on illumos) reject timestamps that do not fit in 32 bits with EOVERFLOW instead of raising OverflowError. (cherry picked from commit 63a2709) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 91839e5 commit 4f55c53

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
@@ -654,6 +655,12 @@ def test_add_file_after_2107(self):
654655
os.utime(TESTFN, (ts, ts))
655656
except OverflowError:
656657
self.skipTest('Host fs cannot set timestamp to required value.')
658+
except OSError as exc:
659+
# Some file systems (e.g. UFS and ZFS on illumos) do not
660+
# support timestamps that do not fit in 32 bits.
661+
if exc.errno != errno.EOVERFLOW:
662+
raise
663+
self.skipTest('Host fs cannot set timestamp to required value.')
657664

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

0 commit comments

Comments
 (0)