Brett Cannon <br...@python.org> added the comment: So technically Python does not know that some bytecode was compiled with optimization flags on; that is simply not carried in the bytecode format. You also cannot rely on file name extensions as the bytecode could have been generated by an interpreter that used .pyo as the file extension for non-optimized bytecode. So you can't really make this an "explicit error" without changing the format of bytecode files.
As for a distribution choice for only shipping bytecode, you should then only ship .pyc files to avoid this issue. Raymond who (most likely) added the optimization is already on the nosy list so he can decide to disagree with me if he wants, but I am personally still not viewing this as a bug. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8379> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com