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
compileall -f doesn't force to write bytecode files #63731
Comments
The force-option from compileall seems not to rebuild the bytecode files if they already exist. Here is an example of 2 calls: root@ubuntu: |
Looking at the compileall module, it appears that -f and options other than -b have never (or, at least, for a long time, not) been supported when directories or files are not supplied and it defaults to <directories from sys.path>. Note the call in main() to compile_path vs those to compile_file or compile_dir. I'm not sure if there was a good reason for the difference but it seems like a bug now. Would you care to work on a patch and/or tests? |
Attached the patch to fix the problem. I did not modify the unit test because the bug was located in the __main__ part of Lib/compileall. |
test_compileall has fairly extensive tests of the command line behavior, added when we refactored from optparse to argparse. So a test should be added for this case. |
Ah, I missed that. I made this assumption because when I executed other modules manually, they were there just for testing functionality (such as shlex and aifc). Added test. |
Tidied up the test. |
New changeset 6afad4f29249 by R David Murray in branch '3.3': New changeset 0e07ab605e0b by R David Murray in branch 'default': |
Thanks, Vajrasky. I did not backport this to 2.7 because the code is different and we don't have proper tests there, so the chance of breaking something is higher than the benefit of fixing it. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: