Commit 1c45012e by Frost Ming Committed by Sébastien Eustace

Correctly handle spaces in executable (#1774)

parent 275d09f9
...@@ -190,7 +190,7 @@ class EnvManager(object): ...@@ -190,7 +190,7 @@ class EnvManager(object):
try: try:
python_version = decode( python_version = decode(
subprocess.check_output( subprocess.check_output(
" ".join( list_to_shell_command(
[ [
python, python,
"-c", "-c",
...@@ -427,7 +427,7 @@ class EnvManager(object): ...@@ -427,7 +427,7 @@ class EnvManager(object):
try: try:
python_version = decode( python_version = decode(
subprocess.check_output( subprocess.check_output(
" ".join( list_to_shell_command(
[ [
python, python,
"-c", "-c",
...@@ -496,7 +496,7 @@ class EnvManager(object): ...@@ -496,7 +496,7 @@ class EnvManager(object):
if executable: if executable:
python_patch = decode( python_patch = decode(
subprocess.check_output( subprocess.check_output(
" ".join( list_to_shell_command(
[ [
executable, executable,
"-c", "-c",
...@@ -553,7 +553,7 @@ class EnvManager(object): ...@@ -553,7 +553,7 @@ class EnvManager(object):
try: try:
python_patch = decode( python_patch = decode(
subprocess.check_output( subprocess.check_output(
" ".join( list_to_shell_command(
[ [
python, python,
"-c", "-c",
...@@ -638,7 +638,9 @@ class EnvManager(object): ...@@ -638,7 +638,9 @@ class EnvManager(object):
# Create virtualenv by using an external executable # Create virtualenv by using an external executable
try: try:
p = subprocess.Popen( p = subprocess.Popen(
" ".join([executable, "-"]), stdin=subprocess.PIPE, shell=True list_to_shell_command([executable, "-"]),
stdin=subprocess.PIPE,
shell=True,
) )
p.communicate(encode(CREATE_VENV_COMMAND.format(path))) p.communicate(encode(CREATE_VENV_COMMAND.format(path)))
except CalledProcessError as e: except CalledProcessError as e:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment