From 9ace884cefb9a97053332fdba37e9b6fc33a9bc9 Mon Sep 17 00:00:00 2001 From: Dan Rose Date: Thu, 9 Jul 2020 20:15:13 -0500 Subject: [PATCH] Prevent crash when getting dynamic properties Since `args` is a string, the `Popen` constructor interprets "/usr/bin/python myscript.py" as a path to an executable instead of "/usr/bin/python" with argument "myscript.py". Adding `shell=True` makes this behave as expected. Fix #584 --- gooey/gui/seeder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gooey/gui/seeder.py b/gooey/gui/seeder.py index 81d10a2..cf8e79a 100644 --- a/gooey/gui/seeder.py +++ b/gooey/gui/seeder.py @@ -12,7 +12,7 @@ def fetchDynamicProperties(target, encoding): dynamically generated defaults with which to seed the UI """ cmd = '{} {}'.format(target, 'gooey-seed-ui --ignore-gooey') - proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) if proc.returncode != 0: out, _ = proc.communicate() return json.loads(out.decode(encoding))