From 6288542146de017d0e07f733cb70dc9456b647c8 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 2 Dec 2016 15:44:04 +0000 Subject: This time, for sure! --- tools/run_tests/jobset.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py index 60c8c19758..8c3b6ddda8 100755 --- a/tools/run_tests/jobset.py +++ b/tools/run_tests/jobset.py @@ -49,21 +49,18 @@ measure_cpu_costs = False _DEFAULT_MAX_JOBS = 16 * multiprocessing.cpu_count() _MAX_RESULT_SIZE = 8192 + +def strip_non_ascii_chars(s): + return ''.join(c for c in s if ord(c) < 128) + + def sanitized_environment(env): sanitized = {} for key, value in env.items(): - print("type(key)=", type(key)) - print("key=", key) - print("type(value)=", type(value)) - print("value=", value) - print("value hex dump:", ' '.join('%x' % ord(c) for c in value)) - print("type(key.encode(errors='ignore'))=", type(key.encode(errors='ignore'))) - print("key.encode(errors='ignore')=", key.encode(errors='ignore')) - print("type(value.encode(errors='ignore'))=", type(value.encode(errors='ignore'))) - print("value.encode(errors='ignore')=", value.encode(errors='ignore')) - sanitized[key.encode(errors='ignore')] = value.encode(errors='ignore') + sanitized[strip_non_ascii_chars(key)] = strip_non_ascii_chars(value) return sanitized + def platform_string(): if platform.system() == 'Windows': return 'windows' -- cgit v1.2.3