-
Notifications
You must be signed in to change notification settings - Fork 422
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
--python
flag is broken on Windows
#1205
Comments
Thank you for opening a separate issue :) Would be great if someone running windows could pick this up. Changes need verifying, that
I might miss some possible invocations methods. |
This actually sounds like a duplicate of #1189. |
@Gitznik: thanks for your support. If I can help with anything, let me know. @chrysle: no, #1189 is about the console script getting appended with |
I opened a PR implementing a quite easy solution: just don't do the I played around with it and as far as I can tell, "requirements" 1-3 mentioned above by @Gitznik hold true. I can't test the 4., as I can not reproduce the original issue (I'm using Windows Store Python since multiple years and never had this problem). |
Describe the bug
The
--python
flag used to work with a executable name in the PATH. E.g.pipx install --python python3.12.exe ...
worked, ifpython3.12.exe
was found on the path.Since #1168, however, this does no longer work. See analysis below.
How to reproduce
On a windows system, pass any python executable available in the PATH.
Expected behavior
It should be possible to pass executables to be found on the PATH to the
--python
flag.Analysis
The changes introduced by #1168 call
os.path.realpath
on the argument before giving it tosubprocess.run
. This causes the current working directory to be prepended andsubprocess.run
can not lookup the executable, as it gets a resolved/absolute (non-existing) path. Note, this is even shadowed in the verbose log, as this prints a version of the cmd, which was not passed throughos.path.realpath
.See my initial direct suggestion in #1186 (comment) to fix (or at least workaround) the issue. I tried to be lazy and not open an issue, but @Gitznik rightfully told me to do so.
The text was updated successfully, but these errors were encountered: