Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid variable name in venv code for symlink failure handling on Windows #124212

Open
JacekDuszenko opened this issue Sep 18, 2024 · 2 comments
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes stdlib Python modules in the Lib dir topic-venv Related to the venv module type-bug An unexpected behavior, bug, or error

Comments

@JacekDuszenko
Copy link
Contributor

JacekDuszenko commented Sep 18, 2024

Bug report

Bug description:

The dst variable in https://github.com/python/cpython/blob/main/Lib/venv/__init__.py#L396 should be named dest. Otherwise it throws the UnboundLocalError: cannot access local variable 'dst' where it is not associated with a value.

I have a PR that fixes this and also adds a test covering this code path.
This is occurring on Python 3.13 and 3.14.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs

@JacekDuszenko JacekDuszenko added the type-bug An unexpected behavior, bug, or error label Sep 18, 2024
@Eclips4 Eclips4 added stdlib Python modules in the Lib dir topic-venv Related to the venv module labels Sep 18, 2024
@Eclips4
Copy link
Member

Eclips4 commented Sep 18, 2024

Thanks for the report!

This is occurring on every version of Python.

Are you sure about that? From what I can see, it only affects 3.13 and 3.14 (current main) branches.

@JacekDuszenko
Copy link
Contributor Author

You are right, updated the description

@Eclips4 Eclips4 added 3.13 bugs and security fixes 3.14 new features, bugs and security fixes labels Sep 18, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 18, 2024
Yhg1s pushed a commit that referenced this issue Sep 30, 2024
…-124211) (#124226)

gh-124212: Fix undefined variable in error message in venv (GH-124211)
(cherry picked from commit ea7fe1f)

Co-authored-by: Jacek <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes stdlib Python modules in the Lib dir topic-venv Related to the venv module type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants
@JacekDuszenko @Eclips4 and others