diff -r f8e435d6a801 Python/pythonrun.c --- a/Python/pythonrun.c Sun Aug 05 00:33:10 2012 +0200 +++ b/Python/pythonrun.c Sun Aug 05 09:58:53 2012 +0900 @@ -974,8 +974,12 @@ #ifdef MS_WINDOWS /* sys.stdin: enable universal newline mode, translate "\r\n" and "\r" newlines to "\n". - sys.stdout and sys.stderr: translate "\n" to "\r\n". */ - newline = NULL; + sys.stdout and sys.stderr: translate "\n" to "\r\n" if + PYTHONUNBUFFERED not set. */ + if (!Py_UnbufferedStdioFlag) + newline = NULL; + else + newline = ""; #else /* sys.stdin: split lines at "\n". sys.stdout and sys.stderr: don't translate newlines (use "\n"). */