[issue35459] Use PyDict_GetItemWithError() instead of PyDict_GetItem()

STINNER Victor report at bugs.python.org
Tue Feb 26 06:21:07 EST 2019


STINNER Victor <vstinner at redhat.com> added the comment:

> It seems like the change introduced a regression: bpo-36110.

While the test has been fixed, IMHO we need to better document this subtle behavior change since it can be surprising.

The test failed because PyObject_GetAttr() no longer ignores exceptions when getting the attribute from the type dictionary. It's a significant change compared to Python 3.7.

Right now, the change has not even a NEWS entry, whereas it's a backward incompatible change!

Don't get my wrong: the change is correct, we don't want to ignore arbitrary exceptions, it's just a matter of documentation.

----------
nosy: +pablogsal
resolution: fixed -> 
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35459>
_______________________________________


More information about the Python-bugs-list mailing list