Run the command without using shell=True.

It mainly allow to run command in directory containing space.
(Hello, `C:\Program Files\...`)
It would also allow to work on directory containning spaces
(`C:\Users\John Doe`) but xapian configure (at least) expressly doesn't
support it :/

- Run the command without shell=True
- The command must be a list instead of a string.
- All options must also be a list (or an iterable).
This commit is contained in:
Matthieu Gautier
2018-06-19 11:27:07 +02:00
parent e87835c61d
commit c99a9bd91f
36 changed files with 326 additions and 298 deletions

View File

@ -294,7 +294,7 @@ def run_command(command, cwd, context, *, env=None, input=None):
kwargs = dict()
if input:
kwargs['stdin'] = subprocess.PIPE
process = subprocess.Popen(command, shell=True, cwd=cwd, env=env, stdout=log or sys.stdout, stderr=subprocess.STDOUT, **kwargs)
process = subprocess.Popen(command, cwd=cwd, env=env, stdout=log or sys.stdout, stderr=subprocess.STDOUT, **kwargs)
if input:
input = input.encode()
while True: