runtime/spawn_subprocess.py
branchsvghmi
changeset 3293 d2b0c768755d
parent 2537 eb4a4cc41914
child 3750 f62625418bff
child 3860 a1d7187b8402
--- a/runtime/spawn_subprocess.py	Thu Jul 29 08:25:26 2021 +0200
+++ b/runtime/spawn_subprocess.py	Thu Jul 29 11:59:28 2021 +0200
@@ -7,6 +7,7 @@
 from __future__ import absolute_import
 import os
 import signal
+import shlex
 import posix_spawn
 
 PIPE = "42"
@@ -104,9 +105,9 @@
     cmd = []
     if isinstance(args[0], str):
         if len(args) == 1:
-            # oversimplified splitting of arguments,
-            # TODO: care about use of simple and double quotes
-            cmd = args[0].split()
+            # splitting of arguments that cares about 
+            # use of simple and double quotes
+            cmd = shlex.split(args[0])
         else:
             cmd = args
     elif isinstance(args[0], list) and len(args) == 1: