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 eric.snow, kakuma, kushal.das, lwcolton, michael.foord
Date 2014-12-11.03:52:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1418269933.69.0.494646006026.issue21600@psf.upfronthosting.co.za>
In-reply-to
Content
At least for CPython sys.modules is initially set to the modules dict on the interpreter struct.  As of 3.4 the import system itself only cares about sys.modules (I'll have to double check on builtin___import__).  However, if I recall correctly at least part of the import C-API interacts directly with the original interpreter copy of the modules dict.

The catch is that setting sys.modules to something else does not also change the dict on the interpreter struct.  So they will be out of sync.  This may cause problems.  In practice I don't think it's a big deal, but there is no guarantee that patching out sys.modules will give you the behavior that you expect.

See also issue #12633.
History
Date User Action Args
2014-12-11 03:52:13eric.snowsetrecipients: + eric.snow, michael.foord, kushal.das, kakuma, lwcolton
2014-12-11 03:52:13eric.snowsetmessageid: <1418269933.69.0.494646006026.issue21600@psf.upfronthosting.co.za>
2014-12-11 03:52:13eric.snowlinkissue21600 messages
2014-12-11 03:52:12eric.snowcreate