Run system commands via shell also in Unix
partial fulfillment of Issue
@@ -454,7 +454,7 @@ class VM:
popen_kw = dict(
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
- shell=platform.system() == "Windows",
+ shell=True,
env=env,
universal_newlines=True,
)
@@ -463,7 +463,9 @@ class VM:
popen_kw["errors"] = "backslashreplace"
popen_kw["encoding"] = encoding
- proc = subprocess.Popen(cmd.argv, **popen_kw)
+ assert cmd.cmd_line.startswith("!")
+ cmd_line = cmd.cmd_line[1:]
+ proc = subprocess.Popen(cmd_line, **popen_kw)
out, err = proc.communicate(input="")
print(out, end="")
print(err, file=sys.stderr, end="")
