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 brett.cannon
Recipients brett.cannon, jnoller, pitrou
Date 2010-02-07.21:48:10
SpamBayes Score 2.75805e-07
Marked as misclassified No
Message-id <1265579292.0.0.0711201165111.issue7875@psf.upfronthosting.co.za>
In-reply-to
Content
OK, I figured this one out. Someone is using importlib.import_module() which uses importlib itself to do the import and not builtins.__import__. That has the side-effect of importlib replacing all None entries in sys.path_importer_cache with the finder that importlib creates (an optimization so that importlib doesn't have to re-construct the finder constantly and to slowly drop the use of None).

There are three ways to fix this. One is to not insert the new finders into sys.path_importer_cache. Two is to have importlib.import_module use __import__. Three is to leave it as-is (and to obviously fix the problem importlib is triggering).

From a selfish perspective I like option 3 since it helps weed out bugs in importlib, but that is unfair to __import__ for testing plus it slows down the test suite overall from importlib being slower. And I won't do option 1 since that would make importlib perform even worse. So I guess that leaves option 2 unless people are actually okay with option 3.
History
Date User Action Args
2010-02-07 21:48:12brett.cannonsetrecipients: + brett.cannon, pitrou, jnoller
2010-02-07 21:48:12brett.cannonsetmessageid: <1265579292.0.0.0711201165111.issue7875@psf.upfronthosting.co.za>
2010-02-07 21:48:10brett.cannonlinkissue7875 messages
2010-02-07 21:48:10brett.cannoncreate