New submission from Brett Cannon:
E.g. _frozen_importlib, builtins, signal.
--
components: Interpreter Core
messages: 181078
nosy: brett.cannon, theller
priority: normal
severity: normal
stage: test needed
status: open
title: Set __loader__ on modules imported by the C level
type:
Changes by Andrew Svetlov andrew.svet...@gmail.com:
--
nosy: +asvetlov
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17098
___
___
Changes by Barry A. Warsaw ba...@python.org:
--
nosy: +barry
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17098
___
___
Python-bugs-list mailing
Brett Cannon added the comment:
Should probably check the state of sys.modules in importlib._bootstrap._setup()
and see if the missing modules are there and then just retroactively set
__loader__ to BuiltinImporter (as is already done in that function for sys and
_imp):
Brett Cannon added the comment:
All cases but signal can be fixed by importlib._bootstrap._setup() by simply
iterating over sys.modules and setting __loader__. Nice and simple. Thanks,
abstraction!
The problem is signal who gives the finger to abstraction. That module gets
imported directly
Roundup Robot added the comment:
New changeset 05747d3bcd9c by Brett Cannon in branch '3.3':
Issue #17098: Make sure every module has __loader__ defined.
http://hg.python.org/cpython/rev/05747d3bcd9c
New changeset 1f1a1b3cc416 by Brett Cannon in branch 'default':
Issue #17098: all modules
Brett Cannon added the comment:
OK, so my solution for signal worked. All fixed now. If any other modules pop
up with __loader__ not set from now on it's because they cheated on import. =)
--
assignee: - brett.cannon
resolution: - fixed
status: open - closed
Brett Cannon added the comment:
Looks like I spoke too soon. I realized I had not written a test so I did it
quickly and it turns out that while this is fixed for 3.3 it isn't for 3.4.
--
status: closed - open
___
Python tracker
Changes by Eric Snow ericsnowcurren...@gmail.com:
--
nosy: +eric.snow
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17098
___
___
Python-bugs-list
Thomas Heller added the comment:
I have only tried my code with 3.4; but still get problems with the modules
'builtins' and '_frozenimportlib'.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17098
Roundup Robot added the comment:
New changeset 4a4688b865ff by Brett Cannon in branch '3.3':
Add a test for fix of issue #17098
http://hg.python.org/cpython/rev/4a4688b865ff
New changeset 19ea454ccdf7 by Brett Cannon in branch '3.3':
Issue #17098: Be more stringent of setting __loader__ on
Brett Cannon added the comment:
OK, 3.3 and 3.4 now have tests and verify everything is working fine.
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17098
___
Thomas Heller added the comment:
I confirm that the bug is fixed, my test-code works now (a modulefinder using
importlib instead of imp to find modules).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17098
Thomas Heller added the comment:
Thanks for the very fast fix Brett :-)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17098
___
___
14 matches
Mail list logo