diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-11-22 01:59:15 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-11-22 01:59:15 (GMT) |
commit | bfc51567f5ca1af7e1950519b8b34037a4f11bb0 (patch) | |
tree | 63e28192327207e4a1d69867661da41e2be8dbd7 /Modules | |
parent | c078f929cb20f3e48fc1636ae8c211bc4f91a483 (diff) | |
download | cpython-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.c | 8 |
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 * |