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.

Author july
Recipients july
Date 2011-02-06.11:03:21
SpamBayes Score 1.1567886e-08
Marked as misclassified No
Message-id <1296990202.6.0.306196036221.issue11132@psf.upfronthosting.co.za>
In-reply-to
Content
july@julynote:~/test> ls -R
.:
c.py  subdir

./subdir:
a.py  b.py
july@julynote:~/test> python3
Python 3.2rc2+ (py3k, Feb  6 2011, 13:06:04) 
[GCC 4.5.0 20100604 [gcc-4_5-branch revision 160292]] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from compileall import compile_dir
>>> compile_dir('.', optimize=1)
Listing . ...
Compiling ./c.py ...
Listing ./subdir ...
Compiling ./subdir/a.py ...
Compiling ./subdir/b.py ...
1
>>> 
july@julynote:~/test> ls -R
.:
c.py  __pycache__  subdir

./__pycache__:
c.cpython-32.pyo

./subdir:
a.py  b.py  __pycache__

./subdir/__pycache__:
a.cpython-32.pyc  b.cpython-32.pyc
july@julynote:~/test>

It seems that the bug was introduced in svn revision 87019 (Add an "optimize" parameter to compile() to control the optimization level, and provide an interface to it in py_compile, compileall and PyZipFile.).

In recursion, 'optimize' parameter is lost and replaced by default -1 (optimize level of the interpreter).

Test patch added.
History
Date User Action Args
2011-02-06 11:03:22julysetrecipients: + july
2011-02-06 11:03:22julysetmessageid: <1296990202.6.0.306196036221.issue11132@psf.upfronthosting.co.za>
2011-02-06 11:03:22julylinkissue11132 messages
2011-02-06 11:03:21julycreate