Message104458
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 |
|
Date |
User |
Action |
Args |
2010-04-28 20:01:42 | Arfrever | set | recipients:
+ Arfrever, barry |
2010-04-28 20:01:41 | Arfrever | set | messageid: <1272484901.98.0.740885457698.issue8563@psf.upfronthosting.co.za> |
2010-04-28 20:01:40 | Arfrever | link | issue8563 messages |
2010-04-28 20:01:40 | Arfrever | create | |
|