From: Guido van Rossum Date: Sat, 11 Jan 1997 19:28:55 +0000 (+0000) Subject: On Windows, -u implies binary mode for stdin/stdout X-Git-Tag: v1.5a1~542 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f22d7e2c69f9095edc2703483ec11a3b7ff931f5;p=python On Windows, -u implies binary mode for stdin/stdout (as well as unbuffered stdout/stderr). --- diff --git a/Modules/main.c b/Modules/main.c index c8b583a455..15d0cc5cca 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -162,6 +162,10 @@ main(argc, argv) } if (unbuffered) { +#ifdef MS_WINDOWS + _setmode(stdin, O_BINARY); + _setmode(stdout, O_BINARY); +#endif #ifndef MPW setbuf(stdout, (char *)NULL); setbuf(stderr, (char *)NULL);