[Zope-dev] Zope crashing on

Shane Hathaway shane@digicool.com
Mon, 17 Jul 2000 15:29:54 -0400


Steve Alexander wrote:
> 
> Zope 2.1.6
> 
> I'm using a "walk the tree" method of updating instances of a Python
> class, using an external method. Is there any reason that the following
> excerpt from an external method would cause Zope to crash shortly after
> it's been run on all suitable objects? The crash happens when I try to
> see one of the converted objects in my browser.
> 
>   def update_state(self):
>       item = getattr(self, 'aq_base', self)
>       item.content_state=PersistentMapping({'review':'public'})
>       item.review_state=ComputedAttribute(\
>               lambda self: self.content_state['review'])
> 
> It seems to do something nasty to ZODB. I need to truncate Data.fs to
> get Zope working again.
> 
> Perhaps I'm misunderstanding something about ComputedAttributes...

You're storing the ComputedAttribute itself in the pickled object. 
AFAIK ComputedAttribute objects can't be pickled.  What you really
want, I think, is to create a review_state ComputedAttribute for the
class, then "del item.review_state" for each instance.

Shane