diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-10-09 10:12:11 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-10-09 10:12:11 (GMT) |
commit | 257d38ffdd5e85c17e14d63e1930e4756864878f (patch) | |
tree | 5ea1ceab49198640d7fbf13317f84354945a7b5a /Doc | |
parent | fc8408cbe85dfc549686036668ceed77f2d8e76f (diff) | |
download | cpython-257d38ffdd5e85c17e14d63e1930e4756864878f.zip cpython-257d38ffdd5e85c17e14d63e1930e4756864878f.tar.gz cpython-257d38ffdd5e85c17e14d63e1930e4756864878f.tar.bz2 |
Issue #9738: Document PyErr_SetString() and PyErr_SetFromErrnoWithFilename()
encodings
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/exceptions.rst | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index 3fce3b2..0094af3 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -134,7 +134,7 @@ in various ways. There is a separate error indicator for each thread. This is the most common way to set the error indicator. The first argument specifies the exception type; it is normally one of the standard exceptions, e.g. :c:data:`PyExc_RuntimeError`. You need not increment its reference count. - The second argument is an error message; it is converted to a string object. + The second argument is an error message; it is decoded from ``'utf-8``'. .. c:function:: void PyErr_SetObject(PyObject *type, PyObject *value) @@ -261,6 +261,8 @@ in various ways. There is a separate error indicator for each thread. *filename* is not *NULL*, it is passed to the constructor of *type* as a third parameter. In the case of exceptions such as :exc:`IOError` and :exc:`OSError`, this is used to define the :attr:`filename` attribute of the exception instance. + *filename* is decoded from the filesystem encoding + (:func:`sys.getfilesystemencoding`). .. c:function:: PyObject* PyErr_SetFromWindowsErr(int ierr) |