Closed samfundev closed 1 year ago
You missed the part under that:
Changed in version 3.8: executable parameter accepts a bytes and path-like object on Windows.
Tested on Windows and confirmed that this does break functionality. This makes sense because Windows also has multiple shells, with more that can be installed. One way to fix this is with:
def run_cmd(cmd, assert_success=False, environment=False, capture_output=False, env=None, executable="/bin/bash" if sys.platform.startswith("linux") else None):
...
# Run shell commands
result = subprocess.run(cmd, shell=True, capture_output=capture_output, env=env, executable=executable)
...
Edited with a better solution.
Actually, I think there might have been something wrong with my setup that was causing this error. If I'm able to reproduce this issue again, I'll reopen this.
If you're not using bash on Linux, there would be problems when the script tried to run commands. This specifies that python should use bash to run commands.
As far as I can tell from the documentation, this shouldn't effect Windows:
I haven't tested this though.