[ZODB-Dev] Maybe stupid question...
Paolo Invernizzi
paoloinvernizzi@dmsware.com
Mon, 17 Mar 2003 11:26:32 +0100
> -----Original Message-----
> I wonder if the underlying problem here is that you're trying to pickle
> a Choice control. Why do you want to pickle one of those?
>
> We use GTK+ (as PyGTK) in our app and we make sure none of the
> Persistent objects hold references to UI controls.
>
> Take care,
I don't have now the code in this machine... but I remember the problem was
that when I "exec in moduledict"
something like "import weakref\m" as a module of a subpackage, the name of
the subpackage is added as the name of the module, and the pickler cannot
find it when "patching" it to persistent-module.
Example... (not tested! I haven't the code!)
sss="""import weakref # but can be something else!
<some code>
"""
Manager.newModule("packagename.modulename",sss) --> lead to
->having "__name__":"packagename.modulename" in dict-of-the-module
exec sss in dict-of-the-module --> lead to having
"packagename.weakref":<weakref module>" in dict-of-the-module
and the pickler used for patching module "sss" to a persistent-module cannot
find packagename.weakref
Basically I've not understood if "packagename" had to be added to "imported"
package in "sss" source...
Paolo Invernizzi