New submission from Arfrever Frehtes Taifersar Arahesis <arfrever....@gmail.com>:
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 ---------- components: Library (Lib) files: compileall.patch keywords: patch messages: 104458 nosy: Arfrever, barry priority: normal severity: normal status: open title: [PEP 3147] compileall.compile_file() creates empty __pycache__ directories for non-.py files versions: Python 3.2 Added file: http://bugs.python.org/file17121/compileall.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8563> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com