Add an errors parameter to open() and TextIOWrapper() to specify error handling.
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;