Skip to content

Commit

Permalink
Roll back forceful assignment of PATH when invoking a local process (m…
Browse files Browse the repository at this point in the history
…icrosoft#708)

Roll back one of the updates from microsoft#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
  • Loading branch information
motus authored Mar 13, 2024
1 parent 808bce3 commit d7c4334
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions mlos_bench/mlos_bench/services/local/local_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d7c4334

Please sign in to comment.