[issue12982] .pyo file cannot be imported

STINNER Victor report at bugs.python.org
Thu Sep 15 11:11:16 CEST 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

> Indeed.  Thanks.  I wish it had been in the documentation. :)  This is yet another reason for me to check how I can submit patches to the doc. :)

Read http://docs.python.org/devguide/ to learn how to get the source of 
the documentation and how to write a patch.

> I also found out that renaming the .pyo file as .pyc makes Python happy upon import.  That's the solution I chose, because I don't want users to have to type "python -O" when calling programs compiled with -O or -OO.

Oh, I didn't know this trick, but yeah PYO and PYC are basically the 
same thing. The main difference is that PYO doesn't contain docstrings 
and doesn't contain "set the current line to ..." bytecode instructions.

----------

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


More information about the Python-bugs-list mailing list