summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Plch <gmarcel.plch@gmail.com>2018-08-03 15:59:19 (GMT)
committerPetr Viktorin <encukou@gmail.com>2018-08-03 15:59:19 (GMT)
commit7b41dbad78c6b03ca2f98800a92a1977d3946643 (patch)
tree6646bd8bb4ed47a60855c7457afdead79075ece3
parentcaba55b3b735405b280273f7d99866a046c18281 (diff)
downloadcpython-7b41dbad78c6b03ca2f98800a92a1977d3946643.zip
cpython-7b41dbad78c6b03ca2f98800a92a1977d3946643.tar.gz
cpython-7b41dbad78c6b03ca2f98800a92a1977d3946643.tar.bz2
bpo-34325: Skip zipfile test for large timestamps when filesystem don't support them. (GH-8656)
When the filesystem doesn't support files with large timestamps, skip testing that such files can be zipped.
-rw-r--r--Lib/test/test_zipfile.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index 3b78b7f..68b56a0 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -556,7 +556,11 @@ class StoredTestsWithSourceFile(AbstractTestsWithSourceFile,
def test_add_file_after_2107(self):
# Set atime and mtime to 2108-12-30
- os.utime(TESTFN, (4386268800, 4386268800))
+ try:
+ os.utime(TESTFN, (4386268800, 4386268800))
+ except OverflowError:
+ self.skipTest('Host fs cannot set timestamp to required value.')
+
with zipfile.ZipFile(TESTFN2, "w") as zipfp:
self.assertRaises(struct.error, zipfp.write, TESTFN)