mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-41842: Add codecs.unregister() function (GH-22360)
Add codecs.unregister() and PyCodec_Unregister() functions to unregister a codec search function.
This commit is contained in:
parent
24ba3b0df5
commit
d332e7b816
11 changed files with 108 additions and 5 deletions
|
@ -10,6 +10,14 @@ Codec registry and support functions
|
|||
As side effect, this tries to load the :mod:`encodings` package, if not yet
|
||||
done, to make sure that it is always first in the list of search functions.
|
||||
|
||||
.. c:function:: int PyCodec_Unregister(PyObject *search_function)
|
||||
|
||||
Unregister a codec search function and clear the registry's cache.
|
||||
If the search function is not registered, do nothing.
|
||||
Return 0 on success. Raise an exception and return -1 on error.
|
||||
|
||||
.. versionadded:: 3.10
|
||||
|
||||
.. c:function:: int PyCodec_KnownEncoding(const char *encoding)
|
||||
|
||||
Return ``1`` or ``0`` depending on whether there is a registered codec for
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue