diff options
author | Ammar Askar <ammar@ammaraskar.com> | 2021-08-24 09:13:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-24 09:13:32 (GMT) |
commit | bb21e28fd08f894ceff2405544a2f257d42b1354 (patch) | |
tree | a42ff3d2bbf386900829c00d6463bb8141260af8 /Lib/compileall.py | |
parent | fa6304a5225787054067bb56089632146d288b20 (diff) | |
download | cpython-bb21e28fd08f894ceff2405544a2f257d42b1354.zip cpython-bb21e28fd08f894ceff2405544a2f257d42b1354.tar.gz cpython-bb21e28fd08f894ceff2405544a2f257d42b1354.tar.bz2 |
bpo-34990: Treat the pyc header's mtime in compileall as an unsigned int (GH-19708)
Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
Diffstat (limited to 'Lib/compileall.py')
-rw-r--r-- | Lib/compileall.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/compileall.py b/Lib/compileall.py index 454465b..3e00477 100644 --- a/Lib/compileall.py +++ b/Lib/compileall.py @@ -221,8 +221,8 @@ def compile_file(fullname, ddir=None, force=False, rx=None, quiet=0, if not force: try: mtime = int(os.stat(fullname).st_mtime) - expect = struct.pack('<4sll', importlib.util.MAGIC_NUMBER, - 0, mtime) + expect = struct.pack('<4sLL', importlib.util.MAGIC_NUMBER, + 0, mtime & 0xFFFF_FFFF) for cfile in opt_cfiles.values(): with open(cfile, 'rb') as chandle: actual = chandle.read(12) |