Repository navigation
WIP: bpo-34990: year 2038 problem in compileall.py #9892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f4757a7
bpo-34990: year 2038 problem in compileall.py
matrixise 96dbdab
Add a blurb entry
matrixise de197d1
Support unsigned long in the tests of compileall.py
matrixise 377f565
Add a test with compileall and the .pyc file with a timestamp >= 2018…
matrixise b7e89cc
Use unsigned long for the header size
matrixise eca7980
Use a bitwise 0xFFFF_FFFF on the mtime of the .pyc files
matrixise 2cc344c
Update
matrixise dc57dde
Fix the mask
matrixise efdae35
Move test_compile_all_2038 to CompileallTestsBase
matrixise 1f30292
reword the blurb entry
matrixise 4ed1e74
Update importlib_external after the modifications in importlib
matrixise ca6c049
Revert my modification in Lib/importlib/_bootstrap_external.py: useless,
matrixise File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add a test with compileall and the .pyc file with a timestamp >= 2018…
…-01-20 Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
- Loading branch information
commit 377f565bc940e3cfcc28cfef62bc5aaf82ddb610
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -200,7 +200,10 @@ class CompileallTestsWithSourceEpoch(CompileallTestsBase, | |
| unittest.TestCase, | ||
| metaclass=SourceDateEpochTestMeta, | ||
| source_date_epoch=True): | ||
| pass | ||
| def test_compile_all_2038(self): | ||
| with open(self.source_path, 'r') as f: | ||
| os.utime(f.name, (2147558400, 2147558400)) # Jan 20, 2038 as touch | ||
| self.assertTrue(compileall.compile_file(pathlib.Path(self.source_path))) | ||
|
|
||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unrelated change. |
||
| class CompileallTestsWithoutSourceEpoch(CompileallTestsBase, | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure, but maybe this is not a good place in this file to add the test in, because SOURCE_DATE_EPOCH changes the default .pyc type to be hash-based, which would not hit the error condition. See #9607
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, just copy the code of @tirkarthi . I will wait for a review from @vstinner or an other core-dev.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be moved to CompileallTestsBase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done