[Checkins] [zopefoundation/persistent] e8b9c8: Avoid raising a SystemError when clearing slots if...
GitHub
noreply at github.com
Mon Mar 20 16:49:33 CET 2017
Branch: refs/heads/master
Home: https://github.com/zopefoundation/persistent
Commit: e8b9c8e9d886e8908f31dc7aa26333311ff8b614
https://github.com/zopefoundation/persistent/commit/e8b9c8e9d886e8908f31dc7aa26333311ff8b614
Author: Jason Madden <jamadden at gmail.com>
Date: 2017-03-20 (Mon, 20 Mar 2017)
Changed paths:
M CHANGES.rst
M persistent/cPersistence.c
M persistent/tests/test_persistence.py
Log Message:
-----------
Avoid raising a SystemError when clearing slots if setstate() failed.
PR #52 introduced a code path to `ghostify` that calls PyErr_Clear()
with the intent to avoid propagating AttributeErrors for slots.
However, if there is an error (like a POSKeyError) raised by
jar.setstate(), then `unghostify` will call ghostify with an error
pending. If the object had slots that weren't set and the
AttributeError was cleared, so was the pending error from setstate. So
when `ghostify` returned NULL that got propagated up to the
interpreter which finds no exception and so raises `SystemError: error
return without exception set`.
This commit makes `unghostify` save and restore the exception state
around the call to PyErr_Clear.
Commit: afeb85bc547db64ed049f71401ae33b3270dd68d
https://github.com/zopefoundation/persistent/commit/afeb85bc547db64ed049f71401ae33b3270dd68d
Author: Tres Seaver <tseaver at palladion.com>
Date: 2017-03-20 (Mon, 20 Mar 2017)
Changed paths:
M CHANGES.rst
M persistent/cPersistence.c
M persistent/tests/test_persistence.py
Log Message:
-----------
Merge pull request #62 from zopefoundation/jam-systemerror
Avoid raising a SystemError when clearing slots if setstate() failed.
Compare: https://github.com/zopefoundation/persistent/compare/aba235959add...afeb85bc547d
More information about the checkins
mailing list