From: Victor Stinner Date: Fri, 7 May 2010 00:57:12 +0000 (+0000) Subject: regrtest.py: disable replace_stdout() on Windows until it is fixed X-Git-Tag: v3.2a1~892 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a3032807f948bcba079bf849e25fb3b79e522500;p=python regrtest.py: disable replace_stdout() on Windows until it is fixed See issue #8533 (problem with newlines on Windows). --- diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index e92a3f700a..00ea0d62b1 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -733,6 +733,9 @@ def findtests(testdir=None, stdtests=STDTESTS, nottests=NOTTESTS): def replace_stdout(): """Set stdout encoder error handler to backslashreplace (as stderr error handler) to avoid UnicodeEncodeError when printing a traceback""" + if os.name == "nt": + # Replace sys.stdout breaks the stdout newlines on Windows: issue #8533 + return stdout = sys.stdout sys.stdout = open(stdout.fileno(), 'w', encoding=stdout.encoding,