[Zope] pickling error

Jens Vagelpohl jens@zope.com
Thu, 4 Jul 2002 10:26:21 -0400


from Acquisition import aq_base

unwrapped_obj = aq_base( wrapped_obj )

i think you can do that in python scripts, too, but i am not sure. i only 
ever used this in python product code or external methods.

jens


On Wednesday, July 3, 2002, at 05:54 , Terry Hancock wrote:

> Hi all,
>
> I'm hoping this is the last mystery before I
> release ... :-D
>
> For good or ill, I used a variation of the MiniPickle
> module (see the example on zope.org) to pack python data
> structures into a cookie.  (I had to add an extra
> hex-encoding part to make legal cookies).
>
> I needed an external python method to do this in the
> prototype, and I thought it'd be trivial to just attach
> these as regular python methods in the product.
>
> However, when I try to call my "mini_dumps" method,
> I get a complaint about not being able to pickle
> an object in an "acquisition wrapper."  A little
> searching on zope.org suggests this is referring to
> the internal mechanism that Zope uses to provide
> acquisition services.
>
> But why wouldn't the external method complain about
> it?  And how can I unwrap this object? (I guess this
> means getting a direct reference to the object instead
> of an indirect one, though I'm still foggy on how
> acquisition works -- it seems pretty magical still).
>
> Thanks,
> Terry
>