Skip to content

#10560 Broke python.exe pip.whl/pip install #11146

Closed as not planned
Closed as not planned
@indygreg

Description

@indygreg

Description

#10560 broke python.exe /path/to/pip.whl/pip install on Windows.

I believe this is a side-effect of using os.path.basename(sys.argv[0]) == "pip" to attempt to check for direct pip invocations. Unfortunately, the new logic fails to handle the special case where python <wheel>/<module> can execute a module in a wheel file.

The python <wheel>/<module> syntax and behavior inside the interpreter with respect to sys.argv is a bit wonky. And using this syntax is probably an edge case. While I think the new behavior is incorrect, I'm unsure whether it is worth anyone's time to fix.

Expected behavior

python.exe /path/to/pip.whl/pip should work.

pip version

22.1.1

Python version

3.8-3.10

OS

Windows

How to Reproduce

python pip.whl/pip install

Output

executing C:\Users\RUNNER~1\AppData\Local\Temp\python-build-9rosg__z\out\python\install\python.exe D:\a\python-build-standalone\python-build-standalone\build\pip-22.1.1-py3-none-any.whl\pip install --no-cache-dir --no-index D:\a\python-build-standalone\python-build-standalone\build\pip-22.1.1-py3-none-any.whl
Processing d:\a\python-build-standalone\python-build-standalone\build\pip-22.1.1-py3-none-any.whl
ERROR: To modify pip, please run the following command:
C:\Users\RUNNER~1\AppData\Local\Temp\python-build-9rosg__z\out\python\install\python.exe -m pip install --no-cache-dir --no-index D:\a\python-build-standalone\python-build-standalone\build\pip-22.1.1-py3-none-any.whl


### Code of Conduct

- [X] I agree to follow the [PSF Code of Conduct](https://www.python.org/psf/conduct/).

Metadata

Metadata

Assignees

No one assigned

    Labels

    resolution: no actionWhen the resolution is to not do anythingtype: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions