aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/jobset.py
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2016-07-11 15:31:19 -0700
committerGravatar Yuchen Zeng <zyc@google.com>2016-07-11 15:31:19 -0700
commit9710106b5c494965c6efbb5b92eeb5c1fcf6a90a (patch)
tree50e0c34caeffc9cb5a283afac246cba41068929b /tools/run_tests/jobset.py
parentf0ec5b673cc525502bec1c945d514b7f021d799c (diff)
parent20b1d58b0c4d44abc04af6c6467b7b217fe54915 (diff)
Merge remote-tracking branch 'upstream/master' into fix_mac_build
Diffstat (limited to 'tools/run_tests/jobset.py')
-rwxr-xr-xtools/run_tests/jobset.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py
index 4fe77487f9..3999537c40 100755
--- a/tools/run_tests/jobset.py
+++ b/tools/run_tests/jobset.py
@@ -47,6 +47,12 @@ measure_cpu_costs = False
_DEFAULT_MAX_JOBS = 16 * multiprocessing.cpu_count()
_MAX_RESULT_SIZE = 8192
+def sanitized_environment(env):
+ sanitized = {}
+ for key, value in env.items():
+ sanitized[str(key).encode()] = str(value).encode()
+ return sanitized
+
def platform_string():
if platform.system() == 'Windows':
return 'windows'
@@ -219,6 +225,7 @@ class Job(object):
env = dict(os.environ)
env.update(self._spec.environ)
env.update(self._add_env)
+ env = sanitized_environment(env)
self._start = time.time()
cmdline = self._spec.cmdline
if measure_cpu_costs: