gh-75646: allow _PyType_Lookup() to raise exceptions#3616
gh-75646: allow _PyType_Lookup() to raise exceptions#3616scoder wants to merge 23 commits intopython:mainfrom
Conversation
…hained name lookups in _PyType_Lookup().
…m update_one_slot().
…r ceases to be a valid base type, there'll probably be larger code sections to change than this one.
…common in Python 3 now. Also make the step from "return NULL" error handling to "goto error" reference cleanup explicit.
Distinguish between "error" and "error with exception" cases in _PyType_LookupUncached(). Fix a reference leak of "mro" on lookup errors. Resolves issues found by Serhiy Storchaka.
…isting) API names. Suggested by Serhiy Storchaka.
…l PyObject_GetItem() for them.
…e-calculation if the mapping is not exactly a dict.
…ential re-calculation if the mapping is not exactly a dict." This reverts commit 1d52082.
… and call PyObject_GetItem() for them." This reverts commit 09e716a.
…g lookup exceptions, just like "_PyType_Lookup()" did previously.
…ce eating lookup exceptions, just like "_PyType_Lookup()" did previously." This reverts commit 4efde8e.
…) from functions that swallow live exceptions.
… handle them in the code that calls these functions.
The one non-exception error case during lookup ("no MRO") is not handled since it is unlikely and not user visible.
Note that this changes the signature of both functions, but they are clearly not public functions.
Currently leads to crashes due to NULL returns without exceptions set. Needs investigation.
|
Two minor points. |
|
This PR is stale because it has been open for 30 days with no activity. |
iritkatriel
left a comment
There was a problem hiding this comment.
This has merge conflicts now.
|
When you're done making the requested changes, leave the comment: And if you don't make the requested changes, you will be put in the comfy chair! |
|
This PR is stale because it has been open for 30 days with no activity. |
|
This PR is stale because it has been open for 30 days with no activity. |
|
@scoder Could you resolve the conflicts? |
|
This PR is stale because it has been open for 30 days with no activity. |
|
This PR is stale because it has been open for 30 days with no activity. |
|
I don't think it's worth it to keep this open; the codebase has diverged too much; . If we agree on the design -- (see the issue), I'd be happy to redo the change. |
This is based off #3279, the first commits are the same, because they touch the same code. FIrst new commit is 6c61028, right after the merge of "master". 6c61028 is a related bug fix, an unchecked error case.
Probably needs new tests that exercise the error conditions.
https://bugs.python.org/issue31465