summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-05-19 17:11:19 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-05-19 17:11:19 (GMT)
commit1802d3f3888b374b8d44470156a98081697a6280 (patch)
tree1451c5cdf6056911ea9d3ff491f2c1f8f9f5429c
parent2ca03c1f7f476445019e67d6b44189b85259ef17 (diff)
downloadcpython-1802d3f3888b374b8d44470156a98081697a6280.zip
cpython-1802d3f3888b374b8d44470156a98081697a6280.tar.gz
cpython-1802d3f3888b374b8d44470156a98081697a6280.tar.bz2
regrtest.py: call replace_stdout() before the first call to print()
print("== ", os.getcwd()) fails if the current working directory is not ASCII whereas sys.stdout encoding is ASCII.
-rwxr-xr-xLib/test/regrtest.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index 00ea0d6..34b743e 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -258,6 +258,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
on the command line.
"""
+ replace_stdout()
+
support.record_original_stdout(sys.stdout)
try:
opts, args = getopt.getopt(sys.argv[1:], 'hvqxsSrf:lu:t:TD:NLR:FwWM:nj:',
@@ -376,7 +378,6 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
elif o in ('-j', '--multiprocess'):
use_mp = int(a)
elif o == '--slaveargs':
- replace_stdout()
args, kwargs = json.loads(a)
try:
result = runtest(*args, **kwargs)
@@ -515,8 +516,6 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
else:
tests = iter(selected)
- replace_stdout()
-
if use_mp:
try:
from threading import Thread