This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients serhiy.storchaka
Date 2017-09-24.17:46:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Initially hasattr() suppressed all raised exceptions. In issue2196 hasattr() was changed to suppress only Exception exceptions and propagate exceptions like SystemExit and KeyboardInterrupt. In issue9666 hasattr() was changed to suppress only AttributeError.

But C API functions, PyObject_HasAttr() and like, were not changed. PyObject_HasAttr() is documented as an equivalent of hasattr(), but there is undocumented difference. The C code that uses PyObject_HasAttr() starves from the same problem as the Python code that used old hasattr().

The only solution of this problem is getting rid of PyObject_HasAttr() if favor of PyObject_GetAttr(). In this issue I'm going to propose a set of PRs that replace PyObject_HasAttr() invocations in different components with more correct code.
Date User Action Args
2017-09-24 17:46:45serhiy.storchakasetrecipients: + serhiy.storchaka
2017-09-24 17:46:45serhiy.storchakasetmessageid: <>
2017-09-24 17:46:45serhiy.storchakalinkissue31572 messages
2017-09-24 17:46:45serhiy.storchakacreate