Skip to content

fix: Update venv redirector detection for Python 3.13 on Windows #2920

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

Merged

Conversation

esafak
Copy link
Contributor

@esafak esafak commented Aug 1, 2025

  • Detect the new venvlauncher.exe and venvwlauncher.exe on Windows for Python 3.13 and later.
  • Previously, virtualenv expected python.exe which is no longer the case on newer Python versions.
  • This ensures that virtualenv can correctly create environments using the system Python interpreter on Windows for Python 3.13+.

Fixes #2851

  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

* Detect the new `venvlauncher.exe` and `venvwlauncher.exe` on Windows for Python 3.13 and later.
* Previously, virtualenv expected `python.exe` which is no longer the case on newer Python versions.
* This ensures that virtualenv can correctly create environments using the system Python interpreter on Windows for Python 3.13+.

Fixes pypa#2851

Signed-off-by: Emre Şafak <[email protected]>
@gaborbernat gaborbernat marked this pull request as draft August 1, 2025 01:03
@gaborbernat
Copy link
Contributor

Marked this as a draft for now 🚧—let’s get the CI sorted, and then feel free to mark it ready for review! 😊

esafak and others added 4 commits August 1, 2025 21:16
* Handle pythonw.exe redirection for venvwlauncher.exe on Python 3.13+.
* This ensures the correct launcher is used when creating virtual environments.

Signed-off-by: Emre Şafak <[email protected]>
*   Modify the `executables` method in `cpython3.py` to correctly handle launcher paths for Python 3.13 and newer on Windows.
*   The change ensures that `venvlauncher.exe` and `venvwlauncher.exe` are used as sources when available, improving the creation of virtual environments with specific interpreter versions.
*   Introduces new `ExePathRefToDest` objects with updated source paths for the executables.

Signed-off-by: Emre Şafak <[email protected]>
*   Correctly create ExePathRefToDest instances for Python 3.13+
    launchers.
*   Update source paths for `venvlauncher.exe` and `venvwlauncher.exe`.
*   Ensure `targets` are correctly populated for the new refs.
*   Import ExePathRefToDest from ref module.

Signed-off-by: Emre Şafak <[email protected]>
@esafak esafak marked this pull request as ready for review August 2, 2025 03:28
@gaborbernat gaborbernat enabled auto-merge (squash) August 2, 2025 03:33
@gaborbernat gaborbernat merged commit 9872144 into pypa:main Aug 2, 2025
42 checks passed
@esafak esafak deleted the fix/2851-venv-redirector-python3.13-windows branch August 2, 2025 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

venv redirector not detected on Python 3.13
2 participants