FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-87915: create a venv executable with the same name as sys.executable by FFY00 · Pull Request #129495 · python/cpython · GitHub

/ cpython Public

GH-87915: create a venv executable with the same name as sys.executable - #129495

Open
FFY00 wants to merge 2 commits into
python:mainfrom
FFY00:gh-87915
Open

GH-87915: create a venv executable with the same name as sys.executable#129495
FFY00 wants to merge 2 commits into
python:mainfrom
FFY00:gh-87915

Conversation

FFY00 commented Jan 31, 2025
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

…ecutable

Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Filipe Laíns <lains@riseup.net>

Copy link
Copy Markdown

Hi @FFY00 is there anything we can do to get this merged please? I just stumbled on this bug and I noticed the PR already exists to fix it (thanks!) but since it has been sitting here for 12 months, I figured it might have been forgotten about.

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 21, 2026

Copy link
Copy Markdown
Contributor

The POSIX half is now redundant: on current main, invoking venv as a renamed interpreter already creates the host name — python3.99 -m venv produces bin/python3.99 alongside python/python3/python3.X. So that hunk adds nothing on POSIX (and it targets pre-rebase code — the PR is conflicting).

The remaining gap is Windows. Since the free-threading rewrite, setup_python on Windows emits python.exe/pythonw.exe and the python3.Xt.exe variants but no bare python3.exe and no host name (init.py L351-393). That's the canonical python3.exe -m venv → WinError 2 from the issue, and this PR adds only the current invocation name, so python3.exe is still missing when venv is launched as python.exe or via py.

For reference, virtualenv emits a fixed set of names rather than the invocation name: POSIX python, python3, python3.X, python3.Xt, <host>; on Windows it also creates python3.exe and the pythonw* group, keyed on the resolved base (interpreter.system_executable) and copying the launcher (cpython/common.py L36-43). A fixed set that always includes python3.exe would cover the Windows case. Two smaller things: using sys._base_executable (what the rest of setup_python uses) rather than sys.executable, and the NEWS file references gh-129382 instead of gh-87915.

github-actions Bot removed the stale Stale PR or inactive for long period of time. label Jun 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL