]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-39502: Skip test_zipfile.test_add_file_after_2107() on AIX (GH-18282)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 30 Jan 2020 15:05:08 +0000 (07:05 -0800)
committerGitHub <noreply@github.com>
Thu, 30 Jan 2020 15:05:08 +0000 (07:05 -0800)
Skip test_zipfile.test_add_file_after_2107() if time.localtime()
fails with OverflowError. It is the case on AIX 6.1 for example.
(cherry picked from commit c232c9110cfefa0935cbf158e35e91746a8a9361)

Co-authored-by: Victor Stinner <vstinner@python.org>
Lib/test/test_zipfile.py
Misc/NEWS.d/next/Tests/2020-01-30-15-04-54.bpo-39502.chbpII.rst [new file with mode: 0644]

index 0737c343cbf5fc71957818eb99156834a3b5da8c..c65de9202c0c4b1b45b01ae2a6e9dd7658531791 100644 (file)
@@ -597,8 +597,13 @@ class StoredTestsWithSourceFile(AbstractTestsWithSourceFile,
 
     def test_add_file_after_2107(self):
         # Set atime and mtime to 2108-12-30
+        ts = 4386268800
         try:
-            os.utime(TESTFN, (4386268800, 4386268800))
+            time.localtime(ts)
+        except OverflowError:
+            self.skipTest(f'time.localtime({ts}) raises OverflowError')
+        try:
+            os.utime(TESTFN, (ts, ts))
         except OverflowError:
             self.skipTest('Host fs cannot set timestamp to required value.')
 
diff --git a/Misc/NEWS.d/next/Tests/2020-01-30-15-04-54.bpo-39502.chbpII.rst b/Misc/NEWS.d/next/Tests/2020-01-30-15-04-54.bpo-39502.chbpII.rst
new file mode 100644 (file)
index 0000000..0a13746
--- /dev/null
@@ -0,0 +1,2 @@
+Skip test_zipfile.test_add_file_after_2107() if :func:`time.localtime` fails
+with :exc:`OverflowError`. It is the case on AIX 6.1 for example.