Message141652
> 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). |
|
Date |
User |
Action |
Args |
2011-08-05 10:50:46 | pitrou | set | recipients:
+ pitrou, brett.cannon, ncoghlan, Sagiv.Malihi |
2011-08-05 10:50:46 | pitrou | set | messageid: <1312541446.23.0.959003233163.issue12680@psf.upfronthosting.co.za> |
2011-08-05 10:50:45 | pitrou | link | issue12680 messages |
2011-08-05 10:50:45 | pitrou | create | |
|