summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-12-03 22:54:21 (GMT)
committerGuido van Rossum <guido@python.org>2007-12-03 22:54:21 (GMT)
commite7fc50f2d03a6b62e4b4201c89b2c0185c90f697 (patch)
tree836034eb187c29177ffaabb74b39ba16ed71ddd1 /Objects
parentc6fe37bab927bd00e0f2fed8a431adb7d2b6d303 (diff)
downloadcpython-e7fc50f2d03a6b62e4b4201c89b2c0185c90f697.zip
cpython-e7fc50f2d03a6b62e4b4201c89b2c0185c90f697.tar.gz
cpython-e7fc50f2d03a6b62e4b4201c89b2c0185c90f697.tar.bz2
Add an errors parameter to open() and TextIOWrapper() to specify error handling.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/complexobject.c1
-rw-r--r--Objects/fileobject.c7
2 files changed, 5 insertions, 3 deletions
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 @@ complex_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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 @@ extern "C" {
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;