[Zope] Can't pickle function objects error

Dieter Maurer dieter at handshake.de
Thu Aug 19 14:36:10 EDT 2004


Gitte Wange wrote at 2004-8-19 10:40 +0200:
>I have tried and google for an answer to this but without any luck.
>I have added an attribute to a class which saves an integer and the 
>above error is raised:
>
>Traceback (innermost last):
>
>    * Module ZPublisher.Publish, line 104, in publish
>    * Module Zope.App.startup, line 221, in commit
>    * Module ZODB.Transaction, line 233, in commit
>    * Module ZODB.Transaction, line 348, in _commit_objects
>    * Module ZODB.Connection, line 417, in commit
>      __traceback_info__: (('Products.MyMediaManager.MediaEvent', 
>'MediaEvent'), '\x00\x00\x00\x00\x00\x00\x1a\x92', '')
>    * Module copy_reg, line 69, in _reduce_ex
>
>TypeError: can't pickle function objects
> ...
>My code looks like this:
>poster_rotation = req.get('poster_rotation', None)
>        if poster_rotation is not None:
>            self._poster_rotation = int(poster_rotation)

The problem above is definitely not caused by the preceeding code!

> ...
>Any hints?

Catch the exception in line 417 of "ZODB.Connection".
Log "str(state)" in the "except:" clause and look at the
log file.

-- 
Dieter


More information about the Zope mailing list