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, georg.brandl, meador.inge, scoder
Date 2012-08-13.15:29:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1344871756.03.0.383666125159.issue15623@psf.upfronthosting.co.za>
In-reply-to
Content
That's helpful, Meador.  With regards to the following, there's more to the story:

> With 3.3 a _frozen_importlib.ExtensionFileLoader loader gets created
> against 'my_test_package/__init__.so'.  This doesn't work because
> ExtensionFileLoader does *not* fixup sys.module when it loads.

In the example Stefan provided, look at my_test_package/__init__.c:921.  You'll find PyInit_my_test_package().  The module creation code from msg168026 comes from that function.  There PyImport_AddModule gets called, which adds the module to interp->modules.  I haven't had time to run this through gdb to see what's happening sys.modules in this case.

In general, I'm not familiar enough with extension modules to know if they are actually responsible for adding themselves to sys.modules.  I do see a number of places in Python/import.c and friends that touch sys.modules.

If importlib is in charge of adding it, though, I'd think that ExtensionFileLoader.load_module would need the module_for_loader decorator.
History
Date User Action Args
2012-08-13 15:29:16eric.snowsetrecipients: + eric.snow, brett.cannon, georg.brandl, scoder, Arfrever, meador.inge
2012-08-13 15:29:16eric.snowsetmessageid: <1344871756.03.0.383666125159.issue15623@psf.upfronthosting.co.za>
2012-08-13 15:29:15eric.snowlinkissue15623 messages
2012-08-13 15:29:15eric.snowcreate