summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-11-22 00:41:45 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-11-22 00:41:45 (GMT)
commit44309e6b3768d6d559491ddf6ca56bfad2adb9b5 (patch)
tree5d71526f8d1b06a39c67191bf55e85e68c205c95 /Modules
parent656aa28cd50d00171d46df30eaeecd45eb0ae32c (diff)
downloadcpython-44309e6b3768d6d559491ddf6ca56bfad2adb9b5.zip
cpython-44309e6b3768d6d559491ddf6ca56bfad2adb9b5.tar.gz
cpython-44309e6b3768d6d559491ddf6ca56bfad2adb9b5.tar.bz2
make FileIO.mode always include 'b'
#4386 Reviewed by Amaury
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 2cec213..0a34eb3 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 *