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 <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
import _pyio
import array
import contextlib
+import errno
import importlib.util
import io
import itertools
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):