Runtime: Better handling of nested strings in spawn_subprocess commandline parsing
--- 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: