[Python-checkins] cpython (2.7): Closes #13638: document PyErr_SetFromErrnoWithFilenameObject,
georg.brandl
python-checkins at python.org
Sun Apr 14 11:16:28 CEST 2013
http://hg.python.org/cpython/rev/4cc94d30926f
changeset: 83342:4cc94d30926f
branch: 2.7
parent: 83336:66ca6d85eb95
user: Georg Brandl <georg at python.org>
date: Sun Apr 14 11:12:16 2013 +0200
summary:
Closes #13638: document PyErr_SetFromErrnoWithFilenameObject,
PyErr_SetFromWindowsErrWithFilenameObject, and
PyErr_SetExcFromWindowsErrWithFilenameObject.
Note that PyErr_SetExcFromWindowsErrWithFilenameObjectAndSomeOtherParametersSoThatTheNameGetsSoLongThatNobodyIsEverGonnaUseThisStrangeFunctionForAnything is still undocumented.
files:
Doc/c-api/exceptions.rst | 38 ++++++++++++++++++++++-----
1 files changed, 30 insertions(+), 8 deletions(-)
diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst
--- a/Doc/c-api/exceptions.rst
+++ b/Doc/c-api/exceptions.rst
@@ -192,12 +192,19 @@
when the system call returns an error.
+.. c:function:: PyObject* PyErr_SetFromErrnoWithFilenameObject(PyObject *type, PyObject *filenameObject)
+
+ Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that if
+ *filenameObject* 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.
+
+
.. c:function:: PyObject* PyErr_SetFromErrnoWithFilename(PyObject *type, const char *filename)
- 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
- 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.
+ Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but the filename
+ is given as a C string.
.. c:function:: PyObject* PyErr_SetFromWindowsErr(int ierr)
@@ -220,14 +227,29 @@
.. versionadded:: 2.3
+.. 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)
- Similar to :c:func:`PyErr_SetFromWindowsErr`, with the additional behavior that
- if *filename* is not *NULL*, it is passed to the constructor of
- :exc:`WindowsError` as a third parameter. Availability: Windows.
+ Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, but the
+ filename is given as a C string. Availability: Windows.
-.. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilename(PyObject *type, int ierr, char *filename)
+.. 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.
+
+ .. versionadded:: 2.3
+
+
+.. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilename(PyObject *type, int ierr, const char *filename)
Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional
parameter specifying the exception type to be raised. Availability: Windows.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list