[New-bugs-announce] [issue22966] py_compile: foo.bar.py → __pycache__/foo.cpython-34.pyc

Piotr Ożarowski report at bugs.python.org
Sat Nov 29 11:16:42 CET 2014


New submission from Piotr Ożarowski:

when py_compile module is asked to create .pyc file for file with invalid name, it doesn't fail or ignore such request - it creates/overwrites .pyc file for sane file name (i.e. ignores everything after dot)

$ touch foo.bar.py
$ python3.4 -m py_compile foo.bar.py
$ ls __pycache__
foo.cpython-34.pyc

Even though foo.bar.py is not a valid file name, some programmers are using such names for plugins which leads to bugs similar to https://lists.debian.org/debian-python/2014/11/msg00061.html.

I will update my scripts to not feed py_compile module with file names containing dot (and remove already generated .pyc files if such files are detected), but please do not generate them or generate .pyc files with invalid file names as well.

----------
messages: 231859
nosy: piotr
priority: normal
severity: normal
status: open
title: py_compile: foo.bar.py → __pycache__/foo.cpython-34.pyc
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22966>
_______________________________________


More information about the New-bugs-announce mailing list