Message99022
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. |
|
Date |
User |
Action |
Args |
2010-02-07 21:48:12 | brett.cannon | set | recipients:
+ brett.cannon, pitrou, jnoller |
2010-02-07 21:48:12 | brett.cannon | set | messageid: <1265579292.0.0.0711201165111.issue7875@psf.upfronthosting.co.za> |
2010-02-07 21:48:10 | brett.cannon | link | issue7875 messages |
2010-02-07 21:48:10 | brett.cannon | create | |
|