summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/exceptions.rst
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2014-02-10 06:05:19 (GMT)
committerLarry Hastings <larry@hastings.org>2014-02-10 06:05:19 (GMT)
commitb082731fbb413a7ff2412a447698fdd65015fd24 (patch)
tree6cb37b4aacee0af28c057079af5545cf92dd1537 /Doc/c-api/exceptions.rst
parentdc62b7e261ab88b4ab967ac2ae307eddbfa0ae09 (diff)
downloadcpython-b082731fbb413a7ff2412a447698fdd65015fd24.zip
cpython-b082731fbb413a7ff2412a447698fdd65015fd24.tar.gz
cpython-b082731fbb413a7ff2412a447698fdd65015fd24.tar.bz2
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 d4065e0..070dd17 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