Skip to content

fix: always use copies for the isolated venv on Windows - #1176

Merged
henryiii merged 1 commit into
pypa:mainfrom
henryiii:henryiii/fix/win-symlinks
Sep 4, 2026
Merged

fix: always use copies for the isolated venv on Windows#1176
henryiii merged 1 commit into
pypa:mainfrom
henryiii:henryiii/fix/win-symlinks

Conversation

@henryiii

@henryiii henryiii commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

The broken probe fixed in #1118 (1.6.0, broken previously) wasn't actually supposed to be there; python -m venv doesn't check for symlink support. Even if symlinks are supported, python don't always work symlinked on Windows. This PR removes the check.

Fixes #1175.

🤖 AI text below 🤖

Version 1.6.0 fixed the symlink probe in #1118. Before that fix the probe always failed on Windows, so every isolated environment was built from copies. After the fix, GitHub Windows runners report symlink support, and venv started to symlink python.exe. A symlinked interpreter cannot find the DLLs of some Python builds, most visibly conda, and pip fails with DLL load failed while importing _ssl / _ctypes. Projects such as xgboost, LightGBM, and partcad have pinned build<1.6 to work around this.

This change removes the probe and hardcodes symlinks=os.name != 'nt', which is the venv CLI default and the behavior all releases before 1.6.0 had in practice. The two tests for the probe are removed with it.

Version 1.6.0 fixed the symlink probe (pypa#1118), so isolated environments
on Windows started using symlinks whenever the filesystem allowed them.
A symlinked python.exe cannot locate the DLLs of some interpreters, most
visibly conda, which fails with "DLL load failed while importing _ssl".
Every earlier release used copies in practice, and copies are the venv
CLI default on Windows, so hardcode that instead of probing.

Fixes pypa#1175

Assisted-by: ClaudeCode:claude-fable-5-1
@henryiii
henryiii force-pushed the henryiii/fix/win-symlinks branch from 9969afc to 83cdd96 Compare September 3, 2026 14:17
@henryiii
henryiii marked this pull request as ready for review September 3, 2026 14:20
@henryiii

henryiii commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

It looks like we've already started merging 2.0 things, but this should be a 1.6.1 patch.

@layday

layday commented Sep 3, 2026

Copy link
Copy Markdown
Member

I don't know how the whole release process we got set up now is gonna work off another branch if we were to cherry-pick this change from an earlier commit.

@henryiii

henryiii commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

I'm sure it won't work the first 7 times, but we'll get there. :)

I'm going to make a v1 branch and try to set it up with cherry-picks shortly after this goes in.

@henryiii
henryiii merged commit 759455d into pypa:main Sep 4, 2026
60 checks passed
@henryiii
henryiii deleted the henryiii/fix/win-symlinks branch September 4, 2026 18:30
henryiii added a commit that referenced this pull request Sep 9, 2026
The broken probe fixed in #1118 (1.6.0, broken previously) wasn't
actually supposed to be there; `python -m venv` doesn't check for
symlink support. Even if symlinks are supported, python don't always
work symlinked on Windows. This PR removes the check.

Fixes #1175.

:robot: _AI text below_ :robot:



Version 1.6.0 fixed the symlink probe in #1118. Before that fix the
probe always failed on Windows, so every isolated environment was built
from copies. After the fix, GitHub Windows runners report symlink
support, and `venv` started to symlink `python.exe`. A symlinked
interpreter cannot find the DLLs of some Python builds, most visibly
conda, and pip fails with `DLL load failed while importing _ssl` /
`_ctypes`. Projects such as xgboost, LightGBM, and partcad have pinned
`build<1.6` to work around this.

This change removes the probe and hardcodes `symlinks=os.name != 'nt'`,
which is the `venv` CLI default and the behavior all releases before
1.6.0 had in practice. The two tests for the probe are removed with it.
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.

Windows source build failure with build 1.6.0.

2 participants