From d7c43349910b91a08f4ac6f1c2872701e8358c78 Mon Sep 17 00:00:00 2001 From: Sergiy Matusevych Date: Wed, 13 Mar 2024 14:23:32 -0700 Subject: [PATCH] Roll back forceful assignment of PATH when invoking a local process (#708) Roll back one of the updates from #705 It breaks tests on both Windows and WSL DevContainer on my PC. * On Windows, `environ` may not have `PATH` at all * On my WSL DevContainer, passing non-null `env` to `subprocess.run` prevents it from finding the right python interpreter --- mlos_bench/mlos_bench/services/local/local_exec.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mlos_bench/mlos_bench/services/local/local_exec.py b/mlos_bench/mlos_bench/services/local/local_exec.py index f09ff67e05c..2ca567dfd45 100644 --- a/mlos_bench/mlos_bench/services/local/local_exec.py +++ b/mlos_bench/mlos_bench/services/local/local_exec.py @@ -195,10 +195,8 @@ def _local_exec_script(self, script_line: str, cmd = [token for subcmd in subcmds for token in subcmd] env: Dict[str, str] = {} - # Need to include at least some basic environment variables to run the script. - env["PATH"] = environ["PATH"] if env_params: - env.update({key: str(val) for (key, val) in env_params.items()}) + env = {key: str(val) for (key, val) in env_params.items()} if sys.platform == 'win32': # A hack to run Python on Windows with env variables set: