Skip to content

gh-143768: Replace a dangling interpreter symlink when creating a venv - #150985

Open
claydugo wants to merge 3 commits into
python:mainfrom
claydugo:gh-143768-venv-symlink-v2
Open

gh-143768: Replace a dangling interpreter symlink when creating a venv#150985
claydugo wants to merge 3 commits into
python:mainfrom
claydugo:gh-143768-venv-symlink-v2

Conversation

@claydugo

@claydugoclaydugo commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

A dangling interpreter symlink in the target directory caused venv to crash with --copies and to silently leave the broken link in place with symlinks.
symlink_or_copy now unlinks a dangling destination symlink first, matching how a stale regular file is already replaced on re-run.

Supersedes #143770, which got stuck in a wedged change-detection state after a bad merge via the GitHub UI.

Comment threadLib/test/test_venv.py Outdated
Comment threadLib/test/test_venv.py Outdated
Comment threadMisc/NEWS.d/next/Library/2026-06-05-16-57-03.gh-issue-143768.RbLnkFx.rst Outdated
@brettcannon
brettcannon enabled auto-merge (squash) August 7, 2026 23:28
@brettcannonbrettcannon self-assigned this Aug 7, 2026
@brettcannon
brettcannon disabled auto-merge August 7, 2026 23:29

@brettcannonbrettcannon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized that there's no doc update about the semantic change. Otherwise LGTM!

@bedevere-app

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@claydugo@brettcannon