Comment 1 for bug 586526

Revision history for this message
Jacob Holm (jacobholm) wrote :

I found a workaround that seems to cover most cases. Just override the _p_changed property in your class like this:

class P(persistent.Persistent):

    _p_changed = property(
        persistent.Persistent._p_changed.__get__,
        persistent.Persistent._p_changed.__set__,
        lambda self: self._p_invalidate(),
        "Workaround for https://bugs.launchpad.net/zodb/+bug/586526",
        )

This should work unless there is code out there that uses persistent.Persistent._p_changed.__delete__ or the c function cPersistence.c:Per_set_changed directly. I'm guessing there is not a lot of code that uses either.

I'm still interested in working on a patch to fix this, but only if I know that it has a chance.