File tree 2 files changed +27
-0
lines changed
2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,22 @@ Registry API for Unicode encoding error handlers
97
97
98
98
Return ``0`` on success, ``-1`` on error.
99
99
100
+ .. c:function:: int PyCodec_UnregisterError(const char *name)
101
+
102
+ Un-register the error handling callback function error under the given error
103
+ policy *name *. :ref: `Standard error policies <serror-handlers >` cannot be
104
+ un-registered.
105
+
106
+ * Return ``-1 `` and set a :exc: `ValueError ` exception if *name * is a
107
+ standard error policy or if an error occurred (in which case the
108
+ existing exception is propagated).
109
+
110
+ * Return ``0`` if no error handler is associated with the given error policy.
111
+
112
+ * Return ``1`` if the error handler was successfully removed.
113
+
114
+ .. versionadded:: 3.14
115
+
100
116
.. c:function:: PyObject* PyCodec_LookupError(const char *name)
101
117
102
118
Lookup the error handling callback function registered under *name *. As a
Original file line number Diff line number Diff line change @@ -439,6 +439,17 @@ handler:
439
439
replacement from the error handler will be put into the output directly.
440
440
441
441
442
+ .. function :: unregister_error(name)
443
+
444
+ Attempt to un-register the error handling function under the name *name *.
445
+
446
+ This raises a :exc: `ValueError ` if *name * denotes a standard error policy
447
+ as specified above. Otherwise, this returns ``True `` if an error handler
448
+ existed for the given *name * and ``False `` otherwise.
449
+
450
+ .. versionadded :: 3.14
451
+
452
+
442
453
Previously registered error handlers (including the standard error handlers)
443
454
can be looked up by name:
444
455
You can’t perform that action at this time.
0 commit comments