From 91d9e52d7d08a05988620fdd7f84e8e7a4bbf913 Mon Sep 17 00:00:00 2001 From: Bhargava Shastry Date: Fri, 26 Apr 2019 11:47:46 +0200 Subject: [PATCH] Fix log parsing error --- scripts/regressions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/regressions.py b/scripts/regressions.py index 8851f4130..f7c07fff3 100755 --- a/scripts/regressions.py +++ b/scripts/regressions.py @@ -2,7 +2,6 @@ from argparse import ArgumentParser import sys -import shutil import os import subprocess import re @@ -49,7 +48,10 @@ class regressor(): return True def process_log(self, logfile): - list = re.findall(self._re_sanitizer_log, open(logfile, 'r').read()) + ## Log may contain non ASCII characters, so we simply stringify them + ## since they don't matter for regular expression matching + rawtext = str(open(logfile, 'rb').read()) + list = re.findall(self._re_sanitizer_log, rawtext) numSuppressedLeaks = list.count("LeakSanitizer") rv = any(word in list for word in self._error_blacklist) return not rv, numSuppressedLeaks