Skip to content

[cherry-pick] release: Prevent virtualenv redirect from occupying .venv - #26170

Merged
Eleanor Boyd (eleanorjboyd) merged 2 commits into
mainfrom
cherry-pick/26168
Sep 29, 2026
Merged

Eleanor Boyd (eleanorjboyd) merged 2 commits into
mainfrom
cherry-pick/26168

Conversation

@vs-code-engineering

Copy link
Copy Markdown

Cherry-pick of #26168 from release/2026.6.

Why

Backport of #26167 for the 2026.6 release branch. virtualenv 21.12 began writing a .venv redirect file when creating .virtualenv in a project with pyproject.toml. The following python -m venv .venv then cannot create the separate stdlib venv directory, breaking the release branch's Windows and Linux venv jobs.

Change

Pass --no-venv-redirect when creating .virtualenv so the existing .virtualenv and .venv tests continue to use their original, separate paths. Exit immediately if stdlib venv creation fails.

Windows unit-test investigation

The Windows ts-unit job also intermittently failed on the first Native Python Finder refresh while the subsequent refresh succeeded. The locator-output diagnostic reproduced the failure: Pet logged Skipping refresh state sync for stale generation 0 because current generation is 1 and returned no environments. The finder had launched a configure request in its constructor without awaiting it, while its first refresh launched another configure and could start before the first completed. Pet suppresses environment notifications from stale configuration generations. Remove the redundant constructor configure; the first refresh already configures and awaits completion before sending the refresh request. The existing non-empty assertion is unchanged and still includes the locator log on failure.

The release branch's Build workflow must pass after this lands before releasing.

@eleanorjboyd Eleanor Boyd (eleanorjboyd) added debt Code quality issues and removed cherry-pick-artifact Auto-generated cherry-pick PR labels Sep 29, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@eleanorjboyd
Eleanor Boyd (eleanorjboyd) merged commit 0f81e0e into main Sep 29, 2026
90 checks passed
@eleanorjboyd
Eleanor Boyd (eleanorjboyd) deleted the cherry-pick/26168 branch September 29, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debt Code quality issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.