New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unclear whether __Pyx_PyDict_GetItemStr should clear exceptions #3091
Comments
I'll have to check, but I think it should only be used in cases where exceptions should get propagated. Swallowing exceptions is not a good idea for a general hash lookup. Sounds like we should use the PyObject_… variant as fallback instead.
|
Some code is certainly written with the assumption that |
Hmm, right, I guess the usage follows the behaviour of |
A reference leak due to calling |
We have
The problem is that the two variants have different semantics when an exceptions occurs during
__eq__
: the first variant sets an exception while the second clears it. So there are probably subtle bugs possible because of this difference.So far, I'm just noting this issue, not fixing it. I do plan to add a new function
__Pyx_PyDict_GetItemStrWithError
which always keeps the exception.The text was updated successfully, but these errors were encountered: