Index: Lib/io.py =================================================================== --- Lib/io.py (revision 67306) +++ Lib/io.py (working copy) @@ -218,7 +218,7 @@ (reading and "r" or "") + (writing and "w" or "") + (appending and "a" or "") + - (updating and "+" or ""), + (updating and "+" or "") + "b", closefd) if buffering is None: buffering = -1 Index: Modules/_fileio.c =================================================================== --- Modules/_fileio.c (revision 67306) +++ Modules/_fileio.c (working copy) @@ -214,6 +214,8 @@ self->readable = self->writable = 1; plus = 1; break; + case 'b': + break; default: PyErr_Format(PyExc_ValueError, "invalid mode: %.200s", mode); @@ -682,12 +684,12 @@ { if (self->readable) { if (self->writable) - return "r+"; + return "rb+"; else - return "r"; + return "rb"; } else - return "w"; + return "wb"; } static PyObject *