py_compile "invalidation_mode" argument doesn't prevent recompilation
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start with the py_compile.compile entry point and trace how its invalidation_mode options are handled when a cfile already exists. Reproduce the example with valid invalidation modes and verify that an up-to-date cfile is not recompiled; add regression coverage for the observed behavior.
Written by the indexing model from the issue text.
Description
Bug report
I use the function py_compile.compile to compile my .py files into .pyc files.
Example of use:
file = "source/path/to/my/file.py"
cfile = "path/to/my/file.pyc"
py_compile.compile(file, cfile)
This function never checks the validity of "cfile" against "file" for any of the valid "invalidation_mode" options, so "file" is always recompiled even when it is not necessary.
Your environment
Tested on python 3.8.8, but the problem seems to be present on higher versions of python (3.10 at least)
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 558
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python/cpython
-
docs pending
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
stdlib type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
stdlib type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
build type-bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
stdlib topic-email type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
🐛 Bug 🔔 Pending processing
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
jumpserver/jumpserver#17584 ·