summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2022-10-20 17:31:51 +0300
committerAlex Grönholm <alex.gronholm@nextday.fi>2022-10-20 17:35:11 +0300
commitef6b4027e74a8271d89ee44b38e43e273882ef77 (patch)
treec2945778d95621fa3c3cd7ce09d6594c8ccd2343 /src
parent88f02bc335d5404991e532e7f3b0fc80437bf4e0 (diff)
downloadwheel-git-fix-411.tar.gz
Fixed pre-1980 file timestamps raising ValueErrorfix-411
Fixes #418.
Diffstat (limited to 'src')
-rw-r--r--src/wheel/wheelfile.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wheel/wheelfile.py b/src/wheel/wheelfile.py
index b985774..f55fc73 100644
--- a/src/wheel/wheelfile.py
+++ b/src/wheel/wheelfile.py
@@ -20,12 +20,14 @@ WHEEL_INFO_RE = re.compile(
-(?P<pyver>[^-]+?)-(?P<abi>[^-]+?)-(?P<plat>[^.]+?)\.whl$""",
re.VERBOSE,
)
+MINIMUM_TIMESTAMP = 315532800 # 1980-01-01 00:00:00 UTC
def get_zipinfo_datetime(timestamp=None):
# Some applications need reproducible .whl files, but they can't do this without
# forcing the timestamp of the individual ZipInfo objects. See issue #143.
timestamp = int(os.environ.get("SOURCE_DATE_EPOCH", timestamp or time.time()))
+ timestamp = max(timestamp, MINIMUM_TIMESTAMP)
return time.gmtime(timestamp)[0:6]