Improve CHANGELOG and code comment
This commit is contained in:
parent
489c61a22d
commit
44cb51010c
|
@ -1 +1 @@
|
|||
Fix handling of mtime to work after year 2038
|
||||
Use the correct modified time for years after 2038 in rewritten ``.pyc`` files.
|
||||
|
|
|
@ -344,8 +344,10 @@ def _write_pyc(state, co, source_stat, pyc):
|
|||
try:
|
||||
with atomicwrites.atomic_write(pyc, mode="wb", overwrite=True) as fp:
|
||||
fp.write(imp.get_magic())
|
||||
# as of now, bytecode header expects 32-bit numbers for size and mtime (#4903)
|
||||
mtime = int(source_stat.mtime) & 0xFFFFFFFF
|
||||
size = source_stat.size & 0xFFFFFFFF
|
||||
# "<LL" stands for 2 unsigned longs, little-ending
|
||||
fp.write(struct.pack("<LL", mtime, size))
|
||||
fp.write(marshal.dumps(co))
|
||||
except EnvironmentError as e:
|
||||
|
|
Loading…
Reference in New Issue