diff options
| author | Alex Grönholm <alex.gronholm@nextday.fi> | 2022-10-20 17:31:51 +0300 |
|---|---|---|
| committer | Alex Grönholm <alex.gronholm@nextday.fi> | 2022-10-20 17:35:11 +0300 |
| commit | ef6b4027e74a8271d89ee44b38e43e273882ef77 (patch) | |
| tree | c2945778d95621fa3c3cd7ce09d6594c8ccd2343 /src | |
| parent | 88f02bc335d5404991e532e7f3b0fc80437bf4e0 (diff) | |
| download | wheel-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.py | 2 |
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] |
