From 9ff9e4c6c18755d436bf7551407c7e7558693433 Mon Sep 17 00:00:00 2001 From: Josef Gruen Date: Tue, 11 Aug 2026 16:39:40 +0200 Subject: [PATCH] fix: change command to string when shell=True --- Python/robodk/robolink.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Python/robodk/robolink.py b/Python/robodk/robolink.py index e945e4c..7053aea 100644 --- a/Python/robodk/robolink.py +++ b/Python/robodk/robolink.py @@ -1418,7 +1418,9 @@ def error_reader(proc): print('Warning: A new instance of RoboDK is being created.') self.NEW_INSTANCE = None if (_platform == "linux" or _platform == "linux2") and os.path.splitext(command[0])[1] == ".sh": - self.NEW_INSTANCE = subprocess.Popen(command, shell=True, executable='/bin/bash', stdout=subprocess.PIPE, stderr=subprocess.PIPE) + import shlex + command_string = shlex.join(str(c) for c in command) + self.NEW_INSTANCE = subprocess.Popen(command_string, shell=True, executable='/bin/bash', stdout=subprocess.PIPE, stderr=subprocess.PIPE) elif _platform == "darwin": # Popen does not work sometimes (such as running from fusion) #startapp = ["/usr/bin/open", command[0].split("/Content")[0]]