The Wayback Machine - https://web.archive.org/web/20240503024033/https://github.com/python/cpython/issues/117786
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

venv with Windows Store base does not have correct sys.path #117786

Closed
zooba opened this issue Apr 11, 2024 · 1 comment
Closed

venv with Windows Store base does not have correct sys.path #117786

zooba opened this issue Apr 11, 2024 · 1 comment
Assignees
Labels
3.13 new features, bugs and security fixes OS-windows release-blocker topic-venv Related to the venv module type-bug An unexpected behavior, bug, or error

Comments

@zooba
Copy link
Member

zooba commented Apr 11, 2024

Bug report

Appears to be new in 3.13.0a6, as I've been using it with a5 and it's only after updating that I noticed.

Basically, the venv's prefix and site-packages directories are not present in sys.path when the base interpreter is from a Store install, and it has the user site. I need to investigate further to figure out exactly why.

Test code:

> python3 -m venv testenv --without-pip
> testenv\Scripts\activate
> python -m site
# expect "$PWD\testenv\Scripts\Lib\site-packages" in list

If anyone wants to help check it out, the Store page for alpha releases is https://www.microsoft.com/store/apps/9PNRBTZXMB4Z

Linked PRs

@zooba zooba added type-bug An unexpected behavior, bug, or error OS-windows 3.13 new features, bugs and security fixes topic-venv Related to the venv module labels Apr 11, 2024
@zooba zooba self-assigned this Apr 11, 2024
@zooba
Copy link
Member Author

zooba commented Apr 11, 2024

Oh right, I did the venvlauncher refactoring for this alpha, so the breakage is 100% my fault 😆

Part of that change was to stop smuggling __PYVENV_LAUNCHER__, but also to stop rewriting argv[0]. Those two should have cancelled each other out, but I guess with the Store packaging it doesn't.

zooba added a commit to zooba/cpython that referenced this issue Apr 12, 2024
zooba added a commit to zooba/cpython that referenced this issue Apr 12, 2024
zooba added a commit to zooba/cpython that referenced this issue Apr 15, 2024
zooba added a commit that referenced this issue Apr 24, 2024
@zooba zooba closed this as completed Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 new features, bugs and security fixes OS-windows release-blocker topic-venv Related to the venv module type-bug An unexpected behavior, bug, or error
Projects
Development

No branches or pull requests

1 participant