Skip to content
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

gh-124665: add _PyCodec_UnregisterError and _codecs._unregister_error #124677

Merged
merged 29 commits into from
Sep 29, 2024

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Sep 27, 2024

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that we should start with a public function. I would prefer to start with a private function instead, it's simpler.

@picnixz
Copy link
Member Author

picnixz commented Sep 28, 2024

@vstinner I followed your advice and only introduced the new array. We'll just need to keep in mind that if we add a new policy, then we should also add it to the array and test it.

@picnixz picnixz changed the title gh-124665: add PyCodec_UnregisterError and codecs.unregister_error gh-124665: add _PyCodec_UnregisterError and _codecs._unregister_error Sep 28, 2024
@picnixz picnixz requested a review from vstinner September 28, 2024 10:59
@picnixz picnixz requested a review from vstinner September 28, 2024 13:48
@@ -21,6 +21,17 @@ extern void _PyCodec_Fini(PyInterpreterState *interp);

extern PyObject* _PyCodec_Lookup(const char *encoding);

/*
* Un-register the error handling callback function error under the given
* name. Only non-built-in error handlers can be un-registered.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below you use "custom". Maybe it's better name than "non-built-in". I don't know.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reworded the docs. WDYT?

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vstinner vstinner merged commit c00964e into python:main Sep 29, 2024
37 checks passed
@vstinner
Copy link
Member

Merged, thank you.

@picnixz picnixz deleted the capi/codecs-unregister-error-124665 branch September 29, 2024 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants