changeset: 70366:8be9eaf5829f user: Victor Stinner date: Wed May 25 02:01:55 2011 +0200 files: Lib/test/regrtest.py description: Issue #8533: regrtest replaces also sys.stdout on Windows Replace sys.stdout to use backslashreplace. Use '\n' newline on all operating systems. diff -r de669b61bca4 -r 8be9eaf5829f Lib/test/regrtest.py --- a/Lib/test/regrtest.py Wed May 25 01:41:22 2011 +0200 +++ b/Lib/test/regrtest.py Wed May 25 02:01:55 2011 +0200 @@ -794,17 +794,14 @@ 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 - import atexit stdout = sys.stdout sys.stdout = open(stdout.fileno(), 'w', encoding=stdout.encoding, errors="backslashreplace", - closefd=False) + closefd=False, + newline='\n') def restore_stdout(): sys.stdout.close()