bpo-34990: Change pyc headers to use 64-bit timestamps by ammaraskar · Pull Request #19651 · python/cpython
I went through git history to find it
Thank you for investigating! I'm speculating but best I can tell the reason & 0xFFFFFFFF was added was to deal with the fact that stat->st_size could be a 64-bit value. The mask likely serves to make sure it fits.
What happens if such new .pyc files created by python-3.7.x are encountered by a python-3.7.0 ?
Aah I see what you mean. Now that I look at it I don't think there's any precedent for backporting changes to the bytecode format mid-release. I think what ends up happening is that because of the MAGIC value change we end up regenerating the pyc files, however this does break pyc only distributions.
I'll leave it to the experts but I don't this can be safely backported.
I've gotten the go ahead from Stephane to continue their work from the previous PR so worst case we can apply that to 3.7 and 3.8