From db9e5737f60c9e904e7a7dc0ed79a916423087ac Mon Sep 17 00:00:00 2001 From: Bob Nystrom Date: Sat, 14 Mar 2015 08:47:31 -0700 Subject: [PATCH] Handle malformed UTF-8 output in test runner. Thanks, Michel! --- script/test.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/script/test.py b/script/test.py index e5dbfd94..27156817 100755 --- a/script/test.py +++ b/script/test.py @@ -151,8 +151,12 @@ def run_test(path): # Invoke wren and run the test. proc = Popen([WREN_APP, path], stdin=PIPE, stdout=PIPE, stderr=PIPE) (out, err) = proc.communicate(input_bytes) - out = out.decode("utf-8").replace('\r\n', '\n') - err = err.decode("utf-8").replace('\r\n', '\n') + + try: + out = out.decode("utf-8").replace('\r\n', '\n') + err = err.decode("utf-8").replace('\r\n', '\n') + except: + fails.append('Error decoding output.') fails = []