Message377922
| Author |
serhiy.storchaka |
| Recipients |
The Compiler, bluetech, gvanrossum, loewis, nascheme, pitrou, serhiy.storchaka, sparkingdark |
| Date |
2020年10月04日.07:42:44 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1601797364.87.0.952495778828.issue41909@roundup.psfhosted.org> |
| In-reply-to |
| Content |
Antoine give me a hint. The problem seems related to using PyDict_GetItem() when look up an attribute in the instance dict. It silences all exceptions (including RecursionError) and this results in silent "no such key in a dict".
But since 3.8 it was replaced with PyDict_GetItemWithError() which preserves RecursionError (see issue35459). I think we can remove Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION now.
As for other case in interning string, Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION was used to guard PyDict_GetItem(). But the current code uses PyDict_SetDefault() (added in 3.4) which does not silence errors. So Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION can be removed in that place too. |
|