summaryrefslogtreecommitdiff
path: root/Doc/c-api/exceptions.rst
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2014-02-09 22:05:19 -0800
committerLarry Hastings <larry@hastings.org>2014-02-09 22:05:19 -0800
commit83a96fd7bda59cc1607f925c224852bac56dbc42 (patch)
tree8e7fbd243e906d3019e73e1e05efcb92bf27c048 /Doc/c-api/exceptions.rst
parenta64c66717480d17d7eeff083e0660240c834a4cc (diff)
downloadcpython-83a96fd7bda59cc1607f925c224852bac56dbc42.tar.gz
Issue #20517: Functions in the os module that accept two filenames
now register both filenames in the exception on failure. This required adding new C API functions allowing OSError exceptions to reference two filenames instead of one.
Diffstat (limited to 'Doc/c-api/exceptions.rst')
-rw-r--r--Doc/c-api/exceptions.rst50
1 files changed, 43 insertions, 7 deletions
diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst
index d4065e08c9..070dd1782b 100644
--- a/Doc/c-api/exceptions.rst
+++ b/Doc/c-api/exceptions.rst
@@ -241,6 +241,15 @@ in various ways. There is a separate error indicator for each thread.
exception instance.
+.. c:function:: PyObject* PyErr_SetFromErrnoWithFilenameObjects(PyObject *type, PyObject *filenameObject, PyObject *filenameObject2)
+
+ Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but takes a second
+ filename object, for raising errors when a function that takes two filenames
+ fails.
+
+.. versionadded:: 3.4
+
+
.. c:function:: PyObject* PyErr_SetFromErrnoWithFilename(PyObject *type, const char *filename)
Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but the filename
@@ -248,6 +257,14 @@ in various ways. There is a separate error indicator for each thread.
(:func:`os.fsdecode`).
+.. c:function:: PyObject* PyErr_SetFromErrnoWithFilenames(PyObject *type, const char *filename, const char *filename2)
+
+ Similar to :c:func:`PyErr_SetFromErrnoWithFilename`, but accepts a
+ second filename.
+
+.. versionadded:: 3.4
+
+
.. c:function:: PyObject* PyErr_SetFromWindowsErr(int ierr)
This is a convenience function to raise :exc:`WindowsError`. If called with
@@ -266,13 +283,6 @@ in various ways. There is a separate error indicator for each thread.
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)
Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, but the
@@ -280,6 +290,14 @@ in various ways. There is a separate error indicator for each thread.
encoding (:func:`os.fsdecode`). Availability: Windows.
+.. c:function:: PyObject* PyErr_SetFromWindowsErrWithFilenames(int ierr, const char *filename, const char *filename2)
+
+ Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, but accepts
+ a second filename. Availability: Windows.
+
+.. versionadded:: 3.4
+
+
.. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilenameObject(PyObject *type, int ierr, PyObject *filename)
Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, with an
@@ -287,12 +305,30 @@ in various ways. There is a separate error indicator for each thread.
Availability: Windows.
+.. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilenameObjects(PyObject *type, int ierr, PyObject *filename, PyObject *filename2)
+
+ Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`,
+ but accepts a second filename object.
+ Availability: Windows.
+
+.. versionadded:: 3.4
+
+
.. 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.
+.. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilenames(PyObject *type, int ierr, const char *filename, const char *filename2)
+
+ Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilename`,
+ but accepts a second filename object.
+ Availability: Windows.
+
+.. versionadded:: 3.4
+
+
.. c:function:: PyObject* PyErr_SetImportError(PyObject *msg, PyObject *name, PyObject *path)
This is a convenience function to raise :exc:`ImportError`. *msg* will be