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 <rep...@bugs.python.org>
<http://bugs.python.org/issue22966>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to