Terry J. Reedy added the comment:

On the side issue: While the example given, which uses the py_compile.compile 
defaults via the command line interface, is useless, I disagree that writing a 
.pyc file for a file without .py is a bug.

Python will run python code with any filename as main module (and not write 
.pyc).  It will only import the *same code* (and normally write .pyc) if the 
filename ends with .py (or .pyw on windows).  However, 'import script' will 
import script.pyc (on the search path) without a script.py file existing.  
Using py_compile.compile('script', 'script.pyc') makes that possible.  (I just 
tried it.)

.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25303>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to