Skip to content

Commit 7bf79ac

Browse files
Preserve UTC semantics for ZIP timestamps
1 parent 888d101 commit 7bf79ac

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Lib/zipimport.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import _io # for open
1818
import marshal # for loads
1919
import time # for mktime
20+
import calendar
2021

2122
__all__ = ['ZipImportError', 'zipimporter']
2223

@@ -749,7 +750,7 @@ def _compile_source(pathname, source, module):
749750
# Convert the date/time values found in the Zip archive to a value
750751
# that's compatible with the time stamp stored in .pyc files.
751752
def _parse_dostime(d, t):
752-
return time.mktime((
753+
return calendar.timegm((
753754
(d >> 9) + 1980, # bits 9..15: year
754755
(d >> 5) & 0xF, # bits 5..8: month
755756
d & 0x1F, # bits 0..4: day

0 commit comments

Comments
 (0)