Skip to content

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

Merged
gaborbernat merged 5 commits intopypa:mainfrom
esafak:fix/2851-venv-redirector-python3.13-windows
Aug 2, 2025
Merged

fix: Update venv redirector detection for Python 3.13 on Windows#2920
gaborbernat merged 5 commits intopypa:mainfrom
esafak:fix/2851-venv-redirector-python3.13-windows

Conversation

@esafak
Copy link
Copy Markdown
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 <3928300+esafak@users.noreply.github.com>
@gaborbernat gaborbernat marked this pull request as draft August 1, 2025 01:03
@gaborbernat
Copy link
Copy Markdown
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 <3928300+esafak@users.noreply.github.com>
*   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 <3928300+esafak@users.noreply.github.com>
*   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 <3928300+esafak@users.noreply.github.com>
@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