]> granicus.if.org Git - python/commitdiff
On Windows, -u implies binary mode for stdin/stdout
authorGuido van Rossum <guido@python.org>
Sat, 11 Jan 1997 19:28:55 +0000 (19:28 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 11 Jan 1997 19:28:55 +0000 (19:28 +0000)
(as well as unbuffered stdout/stderr).

Modules/main.c

index c8b583a455d796af2a390c528a15846e7364937c..15d0cc5ccaf014820d7c559815d1fe3dcaa1a219 100644 (file)
@@ -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);