From de7273e04b3c8e4ca3f8ba32298a5d3d763b3ab3 Mon Sep 17 00:00:00 2001 From: Sid Shanker Date: Sun, 17 May 2015 23:11:02 -0700 Subject: [PATCH] Fixed utf-8 decoding error in build. --- test/run.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/run.py b/test/run.py index a48e1fb2..d7309143 100755 --- a/test/run.py +++ b/test/run.py @@ -290,9 +290,12 @@ def collect_dir_tests(base_dir, test_files, check_thirdparty=False): skip = 'Thirdparty-Library %s not found.' % lib path = os.path.join(base_dir, f_name) - source = open(path).read() - if not is_py3: - source = unicode(source, 'UTF-8') + + if is_py3: + source = open(path, encoding='utf-8').read() + else: + source = unicode(open(path).read(), 'UTF-8') + for case in collect_file_tests(StringIO(source), lines_to_execute): case.path = path