We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6ba8c7e + 4ea699e commit e6b564bCopy full SHA for e6b564b
flit_core/flit_core/wheel.py
@@ -1,7 +1,7 @@
1
import argparse
2
from base64 import urlsafe_b64encode
3
import contextlib
4
-from datetime import datetime
+from datetime import datetime, timezone
5
import hashlib
6
import io
7
import logging
@@ -42,7 +42,8 @@ def zip_timestamp_from_env() -> Optional[tuple]:
42
try:
43
# If SOURCE_DATE_EPOCH is set (e.g. by Debian), it's used for
44
# timestamps inside the zip file.
45
- d = datetime.utcfromtimestamp(int(os.environ['SOURCE_DATE_EPOCH']))
+ t = int(os.environ['SOURCE_DATE_EPOCH'])
46
+ d = datetime.fromtimestamp(t, timezone.utc)
47
except (KeyError, ValueError):
48
# Otherwise, we'll use the mtime of files, and generated files will
49
# default to 2016-1-1 00:00:00
0 commit comments