From 681a14a695bb85efe2550b824270a3da8856d5d0 Mon Sep 17 00:00:00 2001 From: Nicolas Schneider Date: Mon, 22 Feb 2016 22:04:34 +0100 Subject: [PATCH] use sys.stdout.encoding when parsing subprocess output --- run_tests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/run_tests.py b/run_tests.py index 221194993..d4c6ff2fc 100755 --- a/run_tests.py +++ b/run_tests.py @@ -207,8 +207,8 @@ def run_test(testdir, extra_args, should_succeed): stdout=subprocess.PIPE, stderr=subprocess.PIPE) (o, e) = pc.communicate() build_time = time.time() - build_start - stdo += o.decode('utf-8') - stde += e.decode('utf-8') + stdo += o.decode(sys.stdout.encoding) + stde += e.decode(sys.stdout.encoding) if pc.returncode != 0: return TestResult('Compiling source code failed.', stdo, stde, gen_time, build_time) test_start = time.time() @@ -230,8 +230,8 @@ def run_test(testdir, extra_args, should_succeed): pi = subprocess.Popen(install_commands, cwd=test_build_dir, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (o, e) = pi.communicate() - stdo += o.decode('utf-8') - stde += e.decode('utf-8') + stdo += o.decode(sys.stdout.encoding) + stde += e.decode(sys.stdout.encoding) if pi.returncode != 0: return TestResult('Running install failed.', stdo, stde, gen_time, build_time, test_time) return TestResult(validate_install(testdir, install_dir), stdo, stde, gen_time, build_time, test_time)