From f1396457fb01ab9d83c07e07d3771ebf9520e0c8 Mon Sep 17 00:00:00 2001 From: Min RK Date: Thu, 20 Aug 2015 16:40:42 -0700 Subject: [PATCH 1/2] run commands with shell=True appears to be needed on Windows, and should be harmless elsewhere. --- setupbase.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setupbase.py b/setupbase.py index 50f0489a2..4ff60d041 100644 --- a/setupbase.py +++ b/setupbase.py @@ -297,6 +297,7 @@ def mtime(path): def run(cmd, *args, **kwargs): """Echo a command before running it""" log.info(" ".join(cmd)) + kwargs.setdefault('shell', True) return check_call(cmd, *args, **kwargs) From f175b2391ae468de39831e65674012c9543b0ccb Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 28 Aug 2015 08:03:39 -0700 Subject: [PATCH 2/2] shell=True wants a string cmd --- setupbase.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setupbase.py b/setupbase.py index 4ff60d041..091139bfa 100644 --- a/setupbase.py +++ b/setupbase.py @@ -296,8 +296,10 @@ def mtime(path): def run(cmd, *args, **kwargs): """Echo a command before running it""" - log.info(" ".join(cmd)) - kwargs.setdefault('shell', True) + if isinstance(cmd, list): + cmd = ' '.join(map(pipes.quote, cmd)) + log.info('> ' + cmd) + kwargs['shell'] = True return check_call(cmd, *args, **kwargs)