Skip to content

Commit

Permalink
Fix path resolution for python executables looked up in PATH on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
guahki committed Jan 25, 2024
1 parent 10cbc9c commit 02f5fe2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/1205.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix path resolution for python executables looked up in PATH on windows.
2 changes: 1 addition & 1 deletion src/pipx/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def run_subprocess(
# See https://github.com/pypa/pipx/issues/1164
# Conversely, if the binary is a symlink, then we should NOT use the real path, as Python expects to receive the
# symlink in argv[0] so that it can locate the venv.
if not os.path.islink(cmd_str_list[0]) and WINDOWS:
if WINDOWS and os.path.isabs(cmd_str_list[0]) and not os.path.islink(cmd_str_list[0]):
cmd_str_list[0] = os.path.realpath(cmd_str_list[0])
completed_process = subprocess.run(
cmd_str_list,
Expand Down

0 comments on commit 02f5fe2

Please sign in to comment.