Message174967
This issue was split off issue16194 (I am not copying the whole discussion here). It was suggested a new issue is opened for Python3, where a proper fix can be done.
Python internally caches dynamically loaded modules, but the cache is based on the filename only. If one file contains several modules, only the first of them is imported and initialized properly. This interface was previously exposed via imp.load_dynamic, the same codepath is used by importlib.machinery.ExtensionFileLoader now.
A solution is to cache by the (filename, modulename) tuple, which avoids any ambiguity.
I am attaching a simple patch for that, agains current hg tip (80272:ec00f8570c55), and tested with the scripot attached to issue16194.
I have not modified the test suite, I am not sure whether testing compiled modules is actually supported (did not see any compiled files in there), I will be glad for help. |
|
Date |
User |
Action |
Args |
2012-11-06 14:42:53 | eudoxos | set | recipients:
+ eudoxos, brett.cannon, amaury.forgeotdarc, ncoghlan, Arfrever, r.david.murray, docs@python |
2012-11-06 14:42:53 | eudoxos | set | messageid: <1352212973.28.0.0255386645646.issue16421@psf.upfronthosting.co.za> |
2012-11-06 14:42:52 | eudoxos | link | issue16421 messages |
2012-11-06 14:42:52 | eudoxos | create | |
|