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.
-
Launcher will use itself as python if python is a symlink to py
If the installation of python found by
py
to be the best-suited installation is a symbolic link topy
itself, it will call itself again, resulting in a unending loop.To Reproduce
Steps to reproduce the behaviour:
py
to$PATH
so$ which py
shows installation of pyvenv-wrapper
to$PATH
$ venv-wrapper new <name> -p "$(which py)"
$ venv-wrapper use <name>
$ python --version
. No output will appear, becausepy
calls itself repeatedly.Expected behaviour
py
should not call itself but either error or look for an actual python install.Screenshots
$ python --version
blocks until interrupted (e.g. by CTRL + C)System Details (please complete the following information):
Beta Was this translation helpful? Give feedback.
All reactions