When I pass a command with quotes to PtyProcess.spawn, it escapes the quotes, which causes my command to fail. The quotes are required and must not be escaped.
Here is code illustrating the problem:
from winpty import PtyProcess
cmd = 'cmd /c echo foo "bar" "baz"'
proc = PtyProcess.spawn(cmd)
data = proc.read(1024)
print(data)
Expected output:
foo "bar" "baz"
Actual output:
foo \"bar\" \"baz\"
When I pass a command with quotes to PtyProcess.spawn, it escapes the quotes, which causes my command to fail. The quotes are required and must not be escaped.
Here is code illustrating the problem:
Expected output:
foo "bar" "baz"Actual output:
foo \"bar\" \"baz\"