summaryrefslogtreecommitdiffstats
path: root/Include/pyerrors.h
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 /Include/pyerrors.h
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 'Include/pyerrors.h')
-rw-r--r--Include/pyerrors.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index 3e92bb6..f995969 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -53,6 +53,7 @@ typedef struct {
PyObject *myerrno;
PyObject *strerror;
PyObject *filename;
+ PyObject *filename2;
#ifdef MS_WINDOWS
PyObject *winerror;
#endif
@@ -225,13 +226,23 @@ PyAPI_FUNC(PyObject *) PyErr_NoMemory(void);
PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *);
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject(
PyObject *, PyObject *);
+PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObjects(
+ PyObject *, PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(
PyObject *exc,
const char *filename /* decoded from the filesystem encoding */
);
+PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenames(
+ PyObject *exc,
+ /* decoded from the filesystem encoding */
+ const char *filename,
+ const char *filename2
+ );
#if defined(MS_WINDOWS) && !defined(Py_LIMITED_API)
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
PyObject *, const Py_UNICODE *);
+PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilenames(
+ PyObject *, const Py_UNICODE *, const Py_UNICODE *);
#endif /* MS_WINDOWS */
PyAPI_FUNC(PyObject *) PyErr_Format(
@@ -245,22 +256,41 @@ PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(
int ierr,
const char *filename /* decoded from the filesystem encoding */
);
+PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilenames(
+ int ierr,
+ /* decoded from the filesystem encoding */
+ const char *filename,
+ const char *filename2
+ );
#ifndef Py_LIMITED_API
/* XXX redeclare to use WSTRING */
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename(
int, const Py_UNICODE *);
+PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilenames(
+ int, const Py_UNICODE *, const Py_UNICODE *);
#endif
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int);
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject(
PyObject *,int, PyObject *);
+PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObjects(
+ PyObject *,int, PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename(
PyObject *exc,
int ierr,
const char *filename /* decoded from the filesystem encoding */
);
+PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenames(
+ PyObject *exc,
+ int ierr,
+ /* decoded from the filesystem encoding */
+ const char *filename,
+ const char *filename2
+ );
#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename(
PyObject *,int, const Py_UNICODE *);
+PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilenames(
+ PyObject *,int, const Py_UNICODE *, const Py_UNICODE *);
#endif
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int);
#endif /* MS_WINDOWS */