Message255178
zipimport is not PEP 3147 compliant: i.e., it looks for foo.pyc (in the same directory as foo.py) instead of __pycache__/foo.cpython-35.pyc. This is counterintuitive, and unfortunate because it means that installation directories (that obey PEP 3147 conventions) can't be zip archived from filesystems and then used by zipimport.
When support for PEP 488 was added to Python 3.5, zipimport was modified to just delete references to .pyo files, but it needs to know about the new .opt-[12] filename components (as well as the PEP 3147 version tags). As far as I can tell, the current version of zipimport can't import optimized bytecode files, using either the old or new filename conventions.
Finally, none of this behavior is documented. The zipimport docs still mention .pyo files (which were eliminated by PEP 488), and say nothing about the filename conventions expected within zip archives. |
|
Date |
User |
Action |
Args |
2015-11-23 15:44:56 | byrnes | set | recipients:
+ byrnes |
2015-11-23 15:44:56 | byrnes | set | messageid: <1448293496.52.0.845434990633.issue25710@psf.upfronthosting.co.za> |
2015-11-23 15:44:56 | byrnes | link | issue25710 messages |
2015-11-23 15:44:56 | byrnes | create | |
|