Comment 1 for bug 97858

Revision history for this message
PJE (pje-telecommunity) wrote :

Also note that _PyPersist_RegisterDataManager() itself sets
po_state to CHANGED even if register() raised an exception. It's somewhat questionable whether it has any business setting po_state at all; none of the places that call it inside cPersistence rely on it doing this; they all set po_state to CHANGED themselves.

It also appears as though there is considerable redundant code for state management surrounding the places that call _PyPersist_Load(); but the logic used in each case is slightly different. At this point, I'm not 100% positive I've caught all the places that suffer from this same logic error (i.e., leaving po_state CHANGED when an error occurs). :(