Add an errors parameter to open() and TextIOWrapper() to specify error handling.
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index 458d0ba..de4641c 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -915,6 +915,7 @@
return NULL;
}
cr.real = PyFloat_AsDouble(tmp);
+ cr.imag = 0.0; /* Shut up compiler warning */
Py_DECREF(tmp);
}
if (i == NULL) {
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index f740977..9b3ff3e 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -27,15 +27,16 @@
PyObject *
PyFile_FromFd(int fd, char *name, char *mode, int buffering, char *encoding,
- char *newline, int closefd)
+ char *errors, char *newline, int closefd)
{
PyObject *io, *stream, *nameobj = NULL;
io = PyImport_ImportModule("io");
if (io == NULL)
return NULL;
- stream = PyObject_CallMethod(io, "open", "isissi", fd, mode,
- buffering, encoding, newline, closefd);
+ stream = PyObject_CallMethod(io, "open", "isisssi", fd, mode,
+ buffering, encoding, errors,
+ newline, closefd);
Py_DECREF(io);
if (stream == NULL)
return NULL;