[ZODB-Dev] ZODB 3.2 (Zope 2.7) ->3.6 (Zope 2.9) upgrading caveat when using __setattr__

Gfeller Martin Martin.Gfeller at comit.ch
Sat Apr 15 11:05:59 EDT 2006


Dear all

As it took me a while to hunt down this one, I thought I'd share it here (and in the list archive):

Using __setattr__ on a persistent object with the old-style object idiom self.__dict__[name] = value to actually set attribute values causes self._p_oid never to be set. This leads to somewhat obscure failures further on, such as in fsIndex, because None is passed as the oid (without any assertion along the way).

After changing __setattr__ to use persistent.Persistent.__setattr__(self,name,value), everything works fine again. 

Best regards, Martin Gfeller



More information about the ZODB-Dev mailing list