summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-11-22 01:59:15 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-11-22 01:59:15 (GMT)
commitbfc51567f5ca1af7e1950519b8b34037a4f11bb0 (patch)
tree63e28192327207e4a1d69867661da41e2be8dbd7 /Modules
parentc078f929cb20f3e48fc1636ae8c211bc4f91a483 (diff)
downloadcpython-bfc51567f5ca1af7e1950519b8b34037a4f11bb0.zip
cpython-bfc51567f5ca1af7e1950519b8b34037a4f11bb0.tar.gz
cpython-bfc51567f5ca1af7e1950519b8b34037a4f11bb0.tar.bz2
backport r67325: make FileIO.mode always contain 'b'
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_fileio.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/_fileio.c b/Modules/_fileio.c
index b9310f3..65cc99d 100644
--- a/Modules/_fileio.c
+++ b/Modules/_fileio.c
@@ -208,6 +208,8 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
flags |= O_CREAT;
append = 1;
break;
+ case 'b':
+ break;
case '+':
if (plus)
goto bad_mode;
@@ -682,12 +684,12 @@ mode_string(PyFileIOObject *self)
{
if (self->readable) {
if (self->writable)
- return "r+";
+ return "rb+";
else
- return "r";
+ return "rb";
}
else
- return "w";
+ return "wb";
}
static PyObject *