From 0d7a0880396734c9b56b3d62d52d12c226597811 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sun, 22 Jul 2018 16:30:37 +0200 Subject: [PATCH] tools/pyboard: Run exec: command as a string. The Python documentation recommends to pass the command as a string when using Popen(..., shell=True). This is because "sh -c " is used to execute the command and additional arguments after the command string are passed to the shell itself (not the executing command). https://docs.python.org/3.5/library/subprocess.html#subprocess.Popen --- tools/pyboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pyboard.py b/tools/pyboard.py index 16ee41f703..8ccc869d10 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -152,7 +152,7 @@ class ProcessToSerial: def __init__(self, cmd): import subprocess - self.subp = subprocess.Popen(cmd.split(), bufsize=0, shell=True, preexec_fn=os.setsid, + self.subp = subprocess.Popen(cmd, bufsize=0, shell=True, preexec_fn=os.setsid, stdin=subprocess.PIPE, stdout=subprocess.PIPE) # Initially was implemented with selectors, but that adds Python3