summaryrefslogtreecommitdiffstats
path: root/Lib/zipfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/zipfile.py')
-rw-r--r--Lib/zipfile.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index 6da1778..7f23778 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -1151,7 +1151,7 @@ class ZipFile:
_windows_illegal_name_trans_table = None
def __init__(self, file, mode="r", compression=ZIP_STORED, allowZip64=True,
- compresslevel=None):
+ compresslevel=None, *, strict_timestamps=True):
"""Open the ZIP file with mode read 'r', write 'w', exclusive create 'x',
or append 'a'."""
if mode not in ('r', 'w', 'x', 'a'):
@@ -1169,6 +1169,7 @@ class ZipFile:
self.mode = mode
self.pwd = None
self._comment = b''
+ self._strict_timestamps = strict_timestamps
# Check if we were passed a file-like object
if isinstance(file, os.PathLike):
@@ -1677,8 +1678,7 @@ class ZipFile:
" would require ZIP64 extensions")
def write(self, filename, arcname=None,
- compress_type=None, compresslevel=None, *,
- strict_timestamps=True):
+ compress_type=None, compresslevel=None):
"""Put the bytes from filename into the archive under the name
arcname."""
if not self.fp:
@@ -1690,7 +1690,7 @@ class ZipFile:
)
zinfo = ZipInfo.from_file(filename, arcname,
- strict_timestamps=strict_timestamps)
+ strict_timestamps=self._strict_timestamps)
if zinfo.is_dir():
zinfo.compress_size = 0