[C API] Add private _PyCodec_UnregisterError
to un-register custom error handlers
#124665
Labels
_PyCodec_UnregisterError
to un-register custom error handlers
#124665
Feature or enhancement
Proposal:
In order to test the Codecs C API (#123343), I need to be able to un-register a custom codecs error policy, otherwise running the tests would leak since they won't clean the registry.
For now, I've managed to make the tests work without this but it's an ugly hack (namely, relying on the fact that the test suite is executed multiple times when searching for refleaks).
The proposed API is as follows:
It would:
ValueError
while the exception in the second case would be the one raised internally (we would just propagate any exception byPyDict_PopString
).cc @vstinner
EDIT: After discussion, we decided to first make it entirely private and un-documented (documentation still exists at the code level but not in an RST file). If needs arise, we will make it public.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
_PyCodec_UnregisterError
and_codecs._unregister_error
#124677The text was updated successfully, but these errors were encountered: