This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2013年11月09日 06:14 by deleted250130, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| compileall_force.patch | vajrasky, 2013年11月09日 10:57 | review | ||
| compileall_force_v2.patch | vajrasky, 2013年11月10日 09:40 | review | ||
| compileall_force_v3.patch | vajrasky, 2013年11月10日 10:03 | review | ||
| Messages (8) | |||
|---|---|---|---|
| msg202463 - (view) | Author: (deleted250130) | Date: 2013年11月09日 06:14 | |
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:~# python3 -m compileall -f Skipping current directory Listing '/usr/lib/python3.3'... Compiling '/usr/lib/python3.3/__phello__.foo.py'... Compiling '/usr/lib/python3.3/_compat_pickle.py'... Compiling '/usr/lib/python3.3/_dummy_thread.py'... ... Compiling '/usr/lib/python3.3/webbrowser.py'... Compiling '/usr/lib/python3.3/xdrlib.py'... Compiling '/usr/lib/python3.3/zipfile.py'... Listing '/usr/lib/python3.3/plat-x86_64-linux-gnu'... Listing '/usr/lib/python3.3/lib-dynload'... Listing '/usr/local/lib/python3.3/dist-packages'... Listing '/usr/lib/python3/dist-packages'... root@ubuntu:~# python3 -m compileall -f Skipping current directory Listing '/usr/lib/python3.3'... Listing '/usr/lib/python3.3/plat-x86_64-linux-gnu'... Listing '/usr/lib/python3.3/lib-dynload'... Listing '/usr/local/lib/python3.3/dist-packages'... Listing '/usr/lib/python3/dist-packages'... |
|||
| msg202466 - (view) | Author: Ned Deily (ned.deily) * (Python committer) | Date: 2013年11月09日 07:59 | |
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? |
|||
| msg202479 - (view) | Author: Vajrasky Kok (vajrasky) * | Date: 2013年11月09日 10:57 | |
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. |
|||
| msg202490 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2013年11月09日 17:56 | |
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. |
|||
| msg202517 - (view) | Author: Vajrasky Kok (vajrasky) * | Date: 2013年11月10日 09:40 | |
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. |
|||
| msg202518 - (view) | Author: Vajrasky Kok (vajrasky) * | Date: 2013年11月10日 10:03 | |
Tidied up the test. |
|||
| msg206273 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2013年12月16日 01:57 | |
New changeset 6afad4f29249 by R David Murray in branch '3.3': #19532: make compileall with no file/dir args respect -f and -q. http://hg.python.org/cpython/rev/6afad4f29249 New changeset 0e07ab605e0b by R David Murray in branch 'default': Merge: #19532: make compileall with no file/dir args respect -f and -q. http://hg.python.org/cpython/rev/0e07ab605e0b |
|||
| msg206274 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2013年12月16日 01:58 | |
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. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:53 | admin | set | github: 63731 |
| 2013年12月16日 01:58:23 | r.david.murray | set | status: open -> closed versions: - Python 2.7 messages: + msg206274 resolution: fixed stage: needs patch -> resolved |
| 2013年12月16日 01:57:06 | python-dev | set | nosy:
+ python-dev messages: + msg206273 |
| 2013年11月10日 10:03:55 | vajrasky | set | files:
+ compileall_force_v3.patch messages: + msg202518 |
| 2013年11月10日 09:40:49 | vajrasky | set | files:
+ compileall_force_v2.patch messages: + msg202517 |
| 2013年11月09日 17:56:18 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg202490 |
| 2013年11月09日 10:57:07 | vajrasky | set | files:
+ compileall_force.patch nosy: + vajrasky messages: + msg202479 keywords: + patch |
| 2013年11月09日 07:59:16 | ned.deily | set | versions:
+ Python 2.7, Python 3.4 nosy: + ned.deily messages: + msg202466 keywords: + easy stage: needs patch |
| 2013年11月09日 06:14:31 | deleted250130 | create | |