Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix python path resolution on linux #1196

Merged
merged 5 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Update `pipx run` on scripts using `/// script` and no `run` table following the updated version of PEP 723 (#1180)
- Avoid repeated exception logging in a few rare cases (#1192)
- Include `tomli` into `pipx.pyz` (zipapp) so that it can be executed with Python 3.10 or earlier (#1142)
- Fix resolving the python executable path on linux

## 1.4.1

Expand Down
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]):
if not os.path.islink(cmd_str_list[0]) and WINDOWS:
gaborbernat marked this conversation as resolved.
Show resolved Hide resolved
cmd_str_list[0] = os.path.realpath(cmd_str_list[0])
completed_process = subprocess.run(
cmd_str_list,
Expand Down