From b7f1bbc2f8b14a402fa9e42e88919dc0173373ce Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Sat, 22 Sep 2018 16:41:56 +0200 Subject: [PATCH] [test] Fix printing subprocess error messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Decode the string as Python 3 returns bytes string, and also don’t assume that it ends with a new line. --- test/shaping/run-tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/shaping/run-tests.py b/test/shaping/run-tests.py index 73b61c21a..915536b97 100755 --- a/test/shaping/run-tests.py +++ b/test/shaping/run-tests.py @@ -9,7 +9,7 @@ def cmd(command): p = subprocess.Popen ( command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) p.wait () - print (p.stderr.read (), end="") # file=sys.stderr + print (p.stderr.read ().decode ("utf-8").strip ()) # file=sys.stderr return p.stdout.read ().decode ("utf-8").strip (), p.returncode