Nick Coghlan <ncogh...@gmail.com> added the comment:

Checking with importlib.abc and importlib.util (which turned out not to have 
the problem) put me on the right path: the problem is the import of "imp" in 
importlib.__init__

What appears to be happening is that the interpreter sees the partially 
initialised importlib package, considers it good enough, and continues on with 
importing _bootstrap and machinery from source. Control eventually returns to 
__init__ and it overwrites the source version with the frozen version.

Changing the __init__ file to do "import _imp" instead (the same as what 
import_init does in the C code) was enough to fix it.

No patch yet - the actual fix is trivial, but it needs a test.

----------
nosy: +georg.brandl
priority: normal -> release blocker
stage:  -> test needed
type:  -> behavior

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15386>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to