[Zope-dev] UnpickleableError using SESSION in 2.7.2RC1

Dieter Maurer dieter at handshake.de
Tue Jul 20 15:04:48 EDT 2004


Brad Clements wrote at 2004-7-19 11:26 -0400:
>Can sessions store instance objects created by an external method?

It can provided they are picklable...

> ...
>  Module ZODB.Connection, line 416, in commit
>   - __traceback_info__: (('Products.Transience.TransientObject', 'TransientObject'), 
>'\x00\x00\x00\x00\x00\x00\x00%', '')
>UnpickleableError: Cannot pickle <extension class Acquisition.ImplicitAcquirerWrapper at 
>409d7800> objects

Acquisition wrappers are not picklable.

>My external method looks like this::
>
>def CreateInstanceItem(**kw):
>    """Generate an instance item"""
>    return InstanceItem(**kw)

This does not return a wrapped instance.

> ...
>I = container.CreateInstanceItem(userid=userid,..., user=user, ...)
> ...
>SESSION['user_details'] = I
>
>It seems like the 'I' object is wrapped somehow.

Your "I" is not wrapped. The problem must be somewhere else.

Almost surely, the problem is the passed in "user" object which
is an acquisition wrapper and therefore cannot be pickled.

-- 
Dieter


More information about the Zope-Dev mailing list