[issue25710] zipimport is not PEP 3147 or PEP 488 compliant

Łukasz Langa report at bugs.python.org
Tue Feb 2 18:22:51 EST 2016


Łukasz Langa added the comment:

If you're affected, there's a workaround. Use the following script to rewrite paths in your .zip file to be zipimport-compatible:

https://gist.github.com/ambv/909d38bdac4f3e719b7c

It preserves the preamble and all file metadata.

A little context why this is useful: for archives that are effectively "static" environments with entire dependency trees in them, this bug causes both a big slowdown in startup time (counted in seconds), as well as tens of megabytes of .pyc created on the fly. Examples include zipapp-style .pyz, Twitter's .pex or Facebook's .par. 

So while we're waiting for a new zipimport implementation, the workaround listed above should unblock people uzing this form of Python package distribution.

----------
nosy: +lukasz.langa

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


More information about the Python-bugs-list mailing list