[Zope] Own export: UnpickleableError

Thomas Guettler Thomas Guettler <guettli@thomas-guettler.de>
Mon, 7 Jul 2003 22:21:22 +0200


On Mon, Jul 07, 2003 at 07:59:22PM +0200, Dieter Maurer wrote:
> Thomas Güttler wrote at 2003-7-7 17:40 +0200:
>  > I want to pickle parts of my ZODB database and import it on a different 
>  > system. 
>  > 
>  > Is it possible to use the pickle module?
>  > 
>  > The first try results in:
>  >   Error Type: UnpickleableError
>  >   Error Value: Cannot pickle <extension class     
>  >      Acquisition.ImplicitAcquirerWrapper at 40225280> objects
>  > 
>  > How can I ignore some parts in pickle.dump()?
> 
> You unwrap the object (".aq_base") before dumping.
> 
> 
> But: you really should use the "export" API.
> Using "pickle.dump" has a *high* probability to produce garbage
> (as it does not handle persistent subobjects as they should be handled).

Hi Dieter and others,

I used grep to find the export API. ZODB/ExportImport.py seems to be
what you mean. It uses load() of the storage to get the serial (I
think this is the stream of bytes).

Unfortunately I think this won't help me.

All my objects have a reference to the root object. Now I want to
store the state of some objects into a file and read them again into a
different root. I only want to export some attributes of some
objects. I found no hook in source of zope where I could filter for
objects/attributes.

 thomas

-- 
Thomas Guettler <guettli@thomas-guettler.de>
http://www.thomas-guettler.de