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 pitrou
Recipients Sagiv.Malihi, brett.cannon, ncoghlan, pitrou
Date 2011-08-05.10:50:45
SpamBayes Score 5.4102356e-10
Marked as misclassified No
Message-id <1312541446.23.0.959003233163.issue12680@psf.upfronthosting.co.za>
In-reply-to
Content
> PyImport_ExecCodeModuleEx adds the module to sys.modules *before*
> actually executing the code. This is a design flaw (can it really be
> changed? )

I guess it is done so to allow for circular imports.

> The second bug: in cPickle.c: func_class() 
> cPickle 'manually' checks if a module is in sys.modules instead of
> letting the import mechanism do it for him (hence breaking the import
> lock's defense here).

I would guess it is an optimization shortcut. A solution (while keeping the optimization) would be to take the import lock before checking sys.modules.

Note that the _pickle module in 3.x has the same kind of logic, and therefore probably the same issue too (haven't tested).
History
Date User Action Args
2011-08-05 10:50:46pitrousetrecipients: + pitrou, brett.cannon, ncoghlan, Sagiv.Malihi
2011-08-05 10:50:46pitrousetmessageid: <1312541446.23.0.959003233163.issue12680@psf.upfronthosting.co.za>
2011-08-05 10:50:45pitroulinkissue12680 messages
2011-08-05 10:50:45pitroucreate