[3.13] gh-154325: Skip test_add_file_after_2107() if the file system rejects the timestamp (GH-154328) (GH-154333)

serhiy-storchaka <[email protected]>
Newsgroups gmane.comp.python.cvs
Message-ID <[email protected]>
https://github.com/python/cpython/commit/2efd2b8d18659a69ed9069568aa81c2bad7fcaf7
commit: 2efd2b8d18659a69ed9069568aa81c2bad7fcaf7
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-07-21T06:34:46Z
summary:

[3.13] gh-154325: Skip test_add_file_after_2107() if the file system rejects the timestamp (GH-154328) (GH-154333)

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 63a2709b700d5532b8925caca5bc8b9437e7a1f3)

Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>

files:
M Lib/test/test_zipfile/test_core.py

diff --git a/Lib/test/test_zipfile/test_core.py b/Lib/test/test_zipfile/test_core.py
index b97d0bd06dda23c..57bd71481a37626 100644
--- a/Lib/test/test_zipfile/test_core.py
+++ b/Lib/test/test_zipfile/test_core.py
@@ -1,6 +1,7 @@
 import _pyio
 import array
 import contextlib
+import errno
 import importlib.util
 import io
 import itertools
@@ -644,6 +645,12 @@ def test_add_file_after_2107(self):
             os.utime(TESTFN, (ts, ts))
         except OverflowError:
             self.skipTest('Host fs cannot set timestamp to required value.')
+        except OSError as exc:
+            # Some file systems (e.g. UFS and ZFS on illumos) do not
+            # support timestamps that do not fit in 32 bits.
+            if exc.errno != errno.EOVERFLOW:
+                raise
+            self.skipTest('Host fs cannot set timestamp to required value.')
 
         mtime_ns = os.stat(TESTFN).st_mtime_ns
         if mtime_ns != (4386268800 * 10**9):

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.