This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients amaury.forgeotdarc, brian.curtin, gvanrossum, pitrou, v+python
Date 2011-01-06.09:29:53
SpamBayes Score 0.0008500052
Marked as misclassified No
Message-id <>
Ok, actually it boils down to the following code in Modules/main.c:

    if (Py_UnbufferedStdioFlag) {
#if defined(MS_WINDOWS) || defined(__CYGWIN__)
        _setmode(fileno(stdin), O_BINARY);
        _setmode(fileno(stdout), O_BINARY);

... which explains things quite clearly! Archeology leads to r7409 by Guido in 1997:

changeset:   4916:5af9f8a98d93
branch:      trunk
user:        guido
date:        Sat Jan 11 20:28:55 1997 +0100
files:       Modules/main.c
[svn r7409] On Windows, -u implies binary mode for stdin/stdout
(as well as unbuffered stdout/stderr).
Date User Action Args
2011-01-06 09:29:57pitrousetrecipients: + pitrou, gvanrossum, amaury.forgeotdarc, v+python, brian.curtin
2011-01-06 09:29:57pitrousetmessageid: <>
2011-01-06 09:29:53pitroulinkissue10841 messages
2011-01-06 09:29:53pitroucreate