Detect when py is part of a symlink loop
#173
Replies: 5 comments 3 replies
-
|
Why was the Python Launcher symlinked to |
Beta Was this translation helpful? Give feedback.
-
|
If you're trying to get the path to the executable that the Launcher chooses, you could run |
Beta Was this translation helpful? Give feedback.
-
Curiosity made me try whether
My assumption was for |
Beta Was this translation helpful? Give feedback.
-
This should work, though it might not be very useful. One big advantage of virtual python environments is to provide the same version of python for an application to be run with. If a new global install of python was considered more fit by the Launcher the edition of python could change. |
Beta Was this translation helpful? Give feedback.
-
How would the Python Launcher detect this?
Correct, but your example is calling something BTW, I consider this a feature request, so I am going to convert it to a Discussion. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Launcher will use itself as python if python is a symlink to py
If the installation of python found by
pyto be the best-suited installation is a symbolic link topyitself, it will call itself again, resulting in a unending loop.To Reproduce
Steps to reproduce the behaviour:
pyto$PATHso$ which pyshows installation of pyvenv-wrapperto$PATH$ venv-wrapper new <name> -p "$(which py)"$ venv-wrapper use <name>$ python --version. No output will appear, becausepycalls itself repeatedly.Expected behaviour
pyshould not call itself but either error or look for an actual python install.Screenshots

$ python --versionblocks until interrupted (e.g. by CTRL + C)System Details (please complete the following information):
Beta Was this translation helpful? Give feedback.
All reactions