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 Arfrever
Recipients Arfrever, barry
Date 2010-04-28.20:01:39
SpamBayes Score 0.030730372
Marked as misclassified No
Message-id <1272484901.98.0.740885457698.issue8563@psf.upfronthosting.co.za>
In-reply-to
Content
compileall.compile_file() creates empty __pycache__ directories for non-.py files.
This problem usually occurs when compileall.compile_file() is called by compileall.compile_dir() and a subdirectory contains non-code files (e.g. locales, images, templates, documentation).
__pycache__ directories also should not be created when generation of .pyc / .pyo files failed due to e.g. SyntaxErrors.
I'm attaching the patch.

$ mkdir test
$ touch test/file
$ tree test
test
└── file

0 directories, 1 file
$ python3.2 -c 'import compileall; compileall.compile_file("test/file")'
$ tree test
test
├── file
└── __pycache__

1 directory, 1 file
History
Date User Action Args
2010-04-28 20:01:42Arfreversetrecipients: + Arfrever, barry
2010-04-28 20:01:41Arfreversetmessageid: <1272484901.98.0.740885457698.issue8563@psf.upfronthosting.co.za>
2010-04-28 20:01:40Arfreverlinkissue8563 messages
2010-04-28 20:01:40Arfrevercreate