Skip to content

🐛 fix(create): debug build venvlauncher lookup on Windows 3.13+#3151

Merged
gaborbernat merged 3 commits into
pypa:mainfrom
gaborbernat:fix/debug-build-venvlauncher
May 28, 2026
Merged

🐛 fix(create): debug build venvlauncher lookup on Windows 3.13+#3151
gaborbernat merged 3 commits into
pypa:mainfrom
gaborbernat:fix/debug-build-venvlauncher

Conversation

@gaborbernat
Copy link
Copy Markdown
Contributor

@gaborbernat gaborbernat commented May 28, 2026

Windows debug builds (python_d.exe) on CPython 3.13+ never used the venvlauncher_d.exe shim because executables() compared ref.src.name against "python.exe". When the host interpreter is a debug build, src is python_d.exe, so the comparison always failed and the venvlauncher replacement was silently skipped.

🐛 The fix switches to comparing ref.base (the target name, which is always "python.exe") and uses cls.host_python() to locate the launcher in the correct directory. The docs table for supported Python versions is also cleaned up to avoid implying CPython support starts at 3.13+.

The debug build fixture JSON files from #3150 were also missing the debug_build field added in python-discovery 1.4.0, causing AttributeError on all Windows test jobs. The field is now present, and _debug_suffix() uses getattr defensively for any stale cached PythonInfo objects.

The test fixture JSON files lacked the debug_build field added in
python-discovery 1.4.0, causing AttributeError when _debug_suffix()
accessed interpreter.debug_build. Add debug_build to fixtures and
use getattr() defensively for cached PythonInfo objects from older
versions. Also fix docs table removing misleading Free-threaded column.
executables() compared ref.src.name against "python.exe" to find
refs to replace with venvlauncher. For debug builds where the host
exe is python_d.exe, this never matched. Use ref.base (the target
name) and host_python() to locate the launcher correctly.

Add debug build fixture and tests that exercise both the shim and
venvlauncher paths.
@gaborbernat gaborbernat merged commit 6a2d79c into pypa:main May 28, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant