[issue14657] Avoid two importlib copies

Nick Coghlan report at bugs.python.org
Thu Apr 26 03:21:56 CEST 2012


Nick Coghlan <ncoghlan at gmail.com> added the comment:

My plan would be for the frozen version to be entirely implicit, and have only the subsequent import of the version from disk actually modify the public hooks.

However, I realised today that my current patch would break "stdlib-from-zipfile" approaches, so any bootstrapping of importlib from disk would have to take place after zipimport was put in place. That suggests a few possible changes:
- reordering import_init so zipimport is initialised before the bootstrapping step
- possibly downgrading failure of the bootstrapping step to a warning rather than a fatal error (i.e. continuing with the frozen version if the source version can't be found)

This may still all prove to be too complicated and fragile, but I'm not prepared to give up on it yet - having the interpreter pick up on _bootstrap.py changes for the main import system *without* needing to be rebuilt first seems worth a bit of additional complexity in the bootstrapping mechanism.

----------

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


More information about the Python-bugs-list mailing list