Skip to content

Commit

Permalink
Correctly handle spaces in executable (python-poetry#1774)
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming authored and shenek committed Dec 31, 2019
1 parent 8da21ce commit af28d22
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions poetry/utils/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def activate(self, python, io): # type: (str, IO) -> Env
try:
python_version = decode(
subprocess.check_output(
" ".join(
list_to_shell_command(
[
python,
"-c",
Expand Down Expand Up @@ -427,7 +427,7 @@ def remove(self, python): # type: (str) -> Env
try:
python_version = decode(
subprocess.check_output(
" ".join(
list_to_shell_command(
[
python,
"-c",
Expand Down Expand Up @@ -496,7 +496,7 @@ def create_venv(
if executable:
python_patch = decode(
subprocess.check_output(
" ".join(
list_to_shell_command(
[
executable,
"-c",
Expand Down Expand Up @@ -553,7 +553,7 @@ def create_venv(
try:
python_patch = decode(
subprocess.check_output(
" ".join(
list_to_shell_command(
[
python,
"-c",
Expand Down Expand Up @@ -638,7 +638,9 @@ def build_venv(cls, path, executable=None):
# Create virtualenv by using an external executable
try:
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)))
except CalledProcessError as e:
Expand Down

0 comments on commit af28d22

Please sign in to comment.