fix: fix venv paths redirected by Python from MS Store#5931
Merged
neersighted merged 2 commits intopython-poetry:masterfrom Jul 15, 2022
Merged
fix: fix venv paths redirected by Python from MS Store#5931neersighted merged 2 commits intopython-poetry:masterfrom
neersighted merged 2 commits intopython-poetry:masterfrom
Conversation
a37d7d1 to
f881ed9
Compare
5ffda7d to
3766a98
Compare
neersighted
requested changes
Jul 13, 2022
Member
neersighted
left a comment
There was a problem hiding this comment.
It looks like the typing is a bit of a mess -- the get_real_windows_path function takes a Path but immediately coerces it back to a string. Why don't we make it accept a Union of str or Path since that is what goes on internally anyway?
3766a98 to
29a93ea
Compare
Member
Author
Good idea 👍 |
neersighted
approved these changes
Jul 15, 2022
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Running Poetry with Python installed from the Microsoft Store have to tackle multiple issues.
The system's Python interpreter is located at something like
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0. But the user is not allowed to run any executable from there. Instead one should use the binaries locates atC:\Users\username\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\.Another problem us, that applications from the Microsoft Store are not allowed to write directly into
%LocalAppdata%, instead any attempt to do this is redirected to a sandbox folder located atC:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0.The first problem described above is an issue, when trying to find the interpreter, that should be used for creating a new venv. This can be solved by replacing the
%ProgramFiles%part of the path by%LocalAppdata/Microsoft%.The second problem described above is an issue, when a new venv should be created at the default location under
C:\Users\klare\AppData\Local\pypoetry\Cache\virtualenvs. Fortunately when one try to access this place during runtime, thePathobject is a symlink that can be resolved and than be passed to the subprocess call that creates the venv.This
install-poetry.pyscript is affected by the same problems. A possible fix is prepared at python-poetry/install.python-poetry.org#18Resolves: #5331