@@ -148,7 +148,8 @@ in various ways. There is a separate error indicator for each thread.
148148 This function sets the error indicator and returns *NULL *. *exception *
149149 should be a Python exception class. The *format * and subsequent
150150 parameters help format the error message; they have the same meaning and
151- values as in :c:func: `PyUnicode_FromFormat `.
151+ values as in :c:func: `PyUnicode_FromFormat `. *format * is an ASCII-encoding
152+ string.
152153
153154
154155.. c :function :: void PyErr_SetNone (PyObject *type)
@@ -218,7 +219,8 @@ in various ways. There is a separate error indicator for each thread.
218219
219220 Similar to :c:func: `PyErr_SetFromWindowsErr `, with the additional behavior that
220221 if *filename * is not *NULL *, it is passed to the constructor of
221- :exc: `WindowsError ` as a third parameter. Availability: Windows.
222+ :exc: `WindowsError ` as a third parameter. *filename * is decoded from UTF-8.
223+ Availability: Windows.
222224
223225
224226.. c :function :: PyObject* PyErr_SetExcFromWindowsErrWithFilename (PyObject *type, int ierr, char *filename)
@@ -232,7 +234,8 @@ in various ways. There is a separate error indicator for each thread.
232234 Set file, line, and offset information for the current exception. If the
233235 current exception is not a :exc: `SyntaxError `, then it sets additional
234236 attributes, which make the exception printing subsystem think the exception
235- is a :exc: `SyntaxError `.
237+ is a :exc: `SyntaxError `. *filename * is decoded from the filesystem encoding
238+ (:func: `sys.getfilesystemencoding `).
236239
237240.. versionadded:: 3.2
238241
@@ -254,7 +257,7 @@ in various ways. There is a separate error indicator for each thread.
254257.. c:function:: int PyErr_WarnEx(PyObject *category, char *message, int stack_level)
255258
256259 Issue a warning message. The *category * argument is a warning category (see
257- below) or *NULL*; the *message* argument is a message string. *stack_level* is a
260+ below) or *NULL*; the *message* argument is an UTF- 8 encoded string. *stack_level* is a
258261 positive number giving a number of stack frames; the warning will be issued from
259262 the currently executing line of code in that stack frame. A *stack_level * of 1
260263 is the function calling :c:func: `PyErr_WarnEx `, 2 is the function above that,
@@ -294,13 +297,15 @@ in various ways. There is a separate error indicator for each thread.
294297 is a straightforward wrapper around the Python function
295298 :func: `warnings.warn_explicit `, see there for more information. The *module *
296299 and *registry * arguments may be set to *NULL * to get the default effect
297- described there.
300+ described there. *message *, *filename * and *module * are UTF-8 encoded
301+ strings.
298302
299303
300304.. c :function :: int PyErr_WarnFormat (PyObject *category, Py_ssize_t stack_level, const char *format, ...)
301305
302306 Function similar to :c:func: `PyErr_WarnEx `, but use
303- :c:func: `PyUnicode_FromFormat ` to format the warning message.
307+ :c:func: `PyUnicode_FromFormat ` to format the warning message. *format * is
308+ an ASCII-encoded string.
304309
305310 .. versionadded :: 3.2
306311
@@ -437,17 +442,19 @@ The following functions are used to create and modify Unicode exceptions from C.
437442.. c :function :: PyObject* PyUnicodeDecodeError_Create (const char *encoding, const char *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason)
438443
439444 Create a :class: `UnicodeDecodeError ` object with the attributes *encoding *,
440- *object *, *length *, *start *, *end * and *reason *.
445+ *object *, *length *, *start *, *end * and *reason *. *encoding * and *reason * are
446+ UTF-8 encoded strings.
441447
442448.. c :function :: PyObject* PyUnicodeEncodeError_Create (const char *encoding, const Py_UNICODE *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason)
443449
444450 Create a :class: `UnicodeEncodeError ` object with the attributes *encoding *,
445- *object *, *length *, *start *, *end * and *reason *.
451+ *object *, *length *, *start *, *end * and *reason *. *encoding * and *reason * are
452+ UTF-8 encoded strings.
446453
447454.. c :function :: PyObject* PyUnicodeTranslateError_Create (const Py_UNICODE *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason)
448455
449456 Create a :class: `UnicodeTranslateError ` object with the attributes *object *,
450- *length *, *start *, *end * and *reason *.
457+ *length *, *start *, *end * and *reason *. * reason * is an UTF-8 encoded string.
451458
452459.. c :function :: PyObject* PyUnicodeDecodeError_GetEncoding (PyObject *exc)
453460 PyObject * PyUnicodeEncodeError_GetEncoding(PyObject *exc)
0 commit comments