WIP: bpo-34990: year 2038 problem in compileall.py#9892
Conversation
Use 'L' as an unsigned long for the timestamp
|
|
Sorry, something went wrong.
|
@bmwiedemann yep, I was in the plane from PySS and I just commited my code, and now, I just saw the test of @tirkarthi . I am going to include it. |
Sorry, something went wrong.
…-01-20 Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
|
@matrixise Thanks for the PR. I think it's a NEWS entry worthy fix to add a short note that |
Sorry, something went wrong.
|
@tirkarthi please, could you check my PR with the last commits. |
Sorry, something went wrong.
|
btw: the first bad mtime is 0x80000000 or 2147483648 or 2038-01-19T03:14:08+00:00 |
Sorry, something went wrong.
|
@matrixise Thanks, Looks good to me from the context of the issue reported but I have limited understanding about the code so I hope someone else might have a better look. Seems there was some discussion about handling 2038 problem as part of the original PR where this code was added : #4575 (comment) |
Sorry, something went wrong.
|
I think the discussion in PR 4575 was about future-proofing the new .pyc format, but it failed to notice that by 2038, only 31 bits are exhausted and bit 32 (which was erroneously interpreted as the sign-bit here), allows to keep the format alive until 2106 - which we can safely assume out-of-scope for today. |
Sorry, something went wrong.
|
This is the reason why I move to 'L' instead of 'l' |
Sorry, something went wrong.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Check also other parts of the stdlib that work with mtime in pyc files. For example zipimport and checkpyc.py need updates. Maybe there are other parts.
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase And if you don't make the requested changes, you will be poked with soft cushions! |
Sorry, something went wrong.
|
@serhiy-storchaka last update for In https://github.com/python/cpython/blob/master/Lib/zipimport.py#L602 you convert the dword as a uint32 and LGTM. |
Sorry, something went wrong.
|
@vstinner and @serhiy-storchaka I have fixed mtime with 0xFFFF_FFFF and use an unsigned long, where I found |
Sorry, something went wrong.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
zipimport needs truncating the timestamp to 32 bit for comparison.
Also update _code_to_timestamp_pyc() in _bootstrap_external.
Sorry, something went wrong.
|
@serhiy-storchaka can you continue the review with me, because I am a little bit like a chicken without head ;-) I try to understand with |
Sorry, something went wrong.
_pack_uint32() already does "& 0xFFFFFFFF"
|
Due to the WIP in the title I added the DO-NOT-MERGE label. |
Sorry, something went wrong.
|
@brettcannon Thank you, I will continue to work on this issue on the next week, this week I am at the hospital with my daughter. |
Sorry, something went wrong.
|
Only 19 years to go... Can we get this moving again? |
Sorry, something went wrong.
|
Ping @matrixise: they are still some comments of @serhiy-storchaka that you didn't address. |
Sorry, something went wrong.
|
So, I am not serious with this bug, I am going to continue on this bug, I would like to close all my PRs. |
Sorry, something went wrong.
FYI I ignore this issue since it's still tagged as "WIP". I prefer to wait until it's no longer a WIP to review it. |
Sorry, something went wrong.
|
Removing the import team from reviewing as this is still a WIP. We can be added back when it's ready to go. |
Sorry, something went wrong.
It's ok as soon as it's fixed before 2038 :-D |
Sorry, something went wrong.
I am afraid there are way too many places where software is used unchanged for a long time. Even 18 years. And of course this is not the only timebomb waiting to trigger. |
Sorry, something went wrong.
|
It was a joke. Hint: see the emoticon. |
Sorry, something went wrong.
|
Since Stéphane said:
I opened up #19651 with the more permanent solution of using a 64-bit timestamp value as Benjamin originally suggested in their PEP 552 PR. |
Sorry, something went wrong.
|
I pinged @matrixise about this and they said I can feel free to take this on since they're too busy to move forward with it. #19708 is a continuation of this PR to make It should be possible to compare the code for both the solutions now. |
Sorry, something went wrong.
|
Indeed. Thanks for noticing. |
Sorry, something went wrong.
Use 'L' as an unsigned long for the timestamp
https://bugs.python.org/issue34990