Skip to content
Snippets Groups Projects
Commit 768b1db4 authored by Masood Malekghassemi's avatar Masood Malekghassemi
Browse files

Sanitize environment variables in run_tests `jobset`

parent cab9d4f7
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment