From e0f34391a01fadd867502cbc440d7f35e77fbd6d Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 17 Oct 2011 17:22:59 +0200 Subject: ext.spawn: Use shell=True when argument is a string --- ranger/ext/spawn.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ranger/ext/spawn.py b/ranger/ext/spawn.py index b1f04cf6..5e5d6a95 100644 --- a/ranger/ext/spawn.py +++ b/ranger/ext/spawn.py @@ -20,8 +20,10 @@ def spawn(*args): """Runs a program, waits for its termination and returns its stdout""" if len(args) == 1: popen_arguments = args[0] + shell = isinstance(popen_arguments, str) else: popen_arguments = args - process = Popen(popen_arguments, stdout=PIPE) + shell = False + process = Popen(popen_arguments, stdout=PIPE, shell=shell) stdout, stderr = process.communicate() return stdout.decode(ENCODING) -- cgit 1.4.1-2-gfad0