[issue17098] Set __loader__ on modules imported by the C level

2013-02-01 Thread Brett Cannon
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:

[issue17098] Set __loader__ on modules imported by the C level

2013-02-01 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17098 ___ ___

[issue17098] Set __loader__ on modules imported by the C level

2013-02-01 Thread Barry A. Warsaw
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

[issue17098] Set __loader__ on modules imported by the C level

2013-02-01 Thread Brett Cannon
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):

[issue17098] Set __loader__ on modules imported by the C level

2013-02-01 Thread Brett Cannon
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

[issue17098] Set __loader__ on modules imported by the C level

2013-02-01 Thread Roundup Robot
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

[issue17098] Set __loader__ on modules imported by the C level

2013-02-01 Thread Brett Cannon
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

[issue17098] Set __loader__ on modules imported by the C level

2013-02-01 Thread Brett Cannon
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

[issue17098] Set __loader__ on modules imported by the C level

2013-02-01 Thread Eric Snow
Changes by Eric Snow ericsnowcurren...@gmail.com: -- nosy: +eric.snow ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17098 ___ ___ Python-bugs-list

[issue17098] Set __loader__ on modules imported by the C level

2013-02-01 Thread Thomas Heller
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

[issue17098] Set __loader__ on modules imported by the C level

2013-02-01 Thread Roundup Robot
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

[issue17098] Set __loader__ on modules imported by the C level

2013-02-01 Thread Brett Cannon
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 ___

[issue17098] Set __loader__ on modules imported by the C level

2013-02-01 Thread Thomas Heller
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

[issue17098] Set __loader__ on modules imported by the C level

2013-02-01 Thread Thomas Heller
Thomas Heller added the comment: Thanks for the very fast fix Brett :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17098 ___ ___