Kaydet (Commit) 991fc573 authored tarafından Georg Brandl's avatar Georg Brandl

Closes #13638: document PyErr_SetFromErrnoWithFilenameObject,

PyErr_SetFromWindowsErrWithFilenameObject, and
PyErr_SetExcFromWindowsErrWithFilenameObject.

Note that PyErr_SetExcFromWindowsErrWithFilenameObjectAndSomeOtherParametersSoThatTheNameGetsSoLongThatNobodyIsEverGonnaUseThisStrangeFunctionForAnything is still undocumented.
üst 5c4874f7
...@@ -222,13 +222,19 @@ in various ways. There is a separate error indicator for each thread. ...@@ -222,13 +222,19 @@ in various ways. There is a separate error indicator for each thread.
when the system call returns an error. when the system call returns an error.
.. c:function:: PyObject* PyErr_SetFromErrnoWithFilename(PyObject *type, const char *filename) .. c:function:: PyObject* PyErr_SetFromErrnoWithFilenameObject(PyObject *type, PyObject *filenameObject)
Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that if Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that if
*filename* is not *NULL*, it is passed to the constructor of *type* as a third *filenameObject* is not *NULL*, it is passed to the constructor of *type* as
parameter. In the case of exceptions such as :exc:`IOError` and :exc:`OSError`, a third parameter. In the case of exceptions such as :exc:`IOError` and
this is used to define the :attr:`filename` attribute of the exception instance. :exc:`OSError`, this is used to define the :attr:`filename` attribute of the
*filename* is decoded from the filesystem encoding exception instance.
.. c:function:: PyObject* PyErr_SetFromErrnoWithFilename(PyObject *type, const char *filename)
Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but the filename
is given as a C string. *filename* is decoded from the filesystem encoding
(:func:`sys.getfilesystemencoding`). (:func:`sys.getfilesystemencoding`).
...@@ -250,16 +256,28 @@ in various ways. There is a separate error indicator for each thread. ...@@ -250,16 +256,28 @@ in various ways. There is a separate error indicator for each thread.
specifying the exception type to be raised. Availability: Windows. specifying the exception type to be raised. Availability: Windows.
.. c:function:: PyObject* PyErr_SetFromWindowsErrWithFilenameObject(int ierr, PyObject *filenameObject)
Similar to :c:func:`PyErr_SetFromWindowsErr`, with the additional behavior
that if *filenameObject* is not *NULL*, it is passed to the constructor of
:exc:`WindowsError` as a third parameter. Availability: Windows.
.. c:function:: PyObject* PyErr_SetFromWindowsErrWithFilename(int ierr, const char *filename) .. c:function:: PyObject* PyErr_SetFromWindowsErrWithFilename(int ierr, const char *filename)
Similar to :c:func:`PyErr_SetFromWindowsErr`, with the additional behavior that Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, but the
if *filename* is not *NULL*, it is passed to the constructor of filename is given as a C string. *filename* is decoded from the filesystem
:exc:`WindowsError` as a third parameter. *filename* is decoded from the encoding (:func:`sys.getfilesystemencoding`). Availability: Windows.
filesystem encoding (:func:`sys.getfilesystemencoding`). Availability:
Windows.
.. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilenameObject(PyObject *type, int ierr, PyObject *filename)
Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, with an
additional parameter specifying the exception type to be raised.
Availability: Windows.
.. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilename(PyObject *type, int ierr, char *filename) .. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilename(PyObject *type, int ierr, const char *filename)
Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional
parameter specifying the exception type to be raised. Availability: Windows. parameter specifying the exception type to be raised. Availability: Windows.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment