This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.snow
Recipients Arfrever, brett.cannon, eric.snow, ncoghlan, python-dev
Date 2013-12-06.06:35:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1386311708.11.0.398728623736.issue19698@psf.upfronthosting.co.za>
In-reply-to
Content
Is the problem here that builtins (and extension modules) don't necessarily obey the rules to the letter?  load_module() is supposed to use whatever is in sys.modules. [1]  (BuiltinImporter.load_module() is essentially a synonym for _imp.init_builtin(), right?)

So in each PyInit_*() the code should be using the module out of sys.modules...  That sounds like a bug and I expect that the builtin modules and most extension modules don't comply.

That said, I realize the spirit of the load_module() rule is to support reloading, which is mostly not applicable to builtins and extension modules.  The code you reverted would rely on enforcing the rule outside the implicit applicability.

I'll be glad when we've resolved the extension module API changes that support exec_module()!

[1] http://docs.python.org/dev/library/importlib.html#importlib.abc.Loader.load_module
History
Date User Action Args
2013-12-06 06:35:08eric.snowsetrecipients: + eric.snow, brett.cannon, ncoghlan, Arfrever, python-dev
2013-12-06 06:35:08eric.snowsetmessageid: <1386311708.11.0.398728623736.issue19698@psf.upfronthosting.co.za>
2013-12-06 06:35:08eric.snowlinkissue19698 messages
2013-12-06 06:35:07eric.snowcreate