From 2354a90008043b0679e46c09165a9e53e47d39ab Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 18 Apr 2020 20:28:25 +0200 Subject: [PATCH] tests: fix subset/run-tests.py under Windows It assumed that stdout of a subprocess in binary mode was using utf-8 which isn't the case. Instead open stdout of the subprocess in text mode and let Python handle the decoding. --- test/subset/run-tests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/subset/run-tests.py b/test/subset/run-tests.py index 1593e620a..4b1fbad1d 100755 --- a/test/subset/run-tests.py +++ b/test/subset/run-tests.py @@ -23,7 +23,8 @@ if not fonttools: def cmd(command): p = subprocess.Popen ( - command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + universal_newlines=True) (stdoutdata, stderrdata) = p.communicate () print (stderrdata, end="") # file=sys.stderr return stdoutdata, p.returncode @@ -91,7 +92,7 @@ def run_ttx (file): def strip_check_sum (ttx_string): return re.sub ('checkSumAdjustment value=["]0x([0-9a-fA-F])+["]', 'checkSumAdjustment value="0x00000000"', - ttx_string.decode ("utf-8"), count=1) + ttx_string, count=1) def has_ots (): if not ots_sanitize: