You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
% python t.py
Traceback (most recent call last):
File "…/Vcs/pythonfinder/t.py", line 4, in <module>
print(finder.find_all_python_versions())
File "…/Vcs/pythonfinder/src/pythonfinder/pythonfinder.py", line 322, in find_all_python_versions
versions = self.system_path.find_all_python_versions(
File "…/Vcs/pythonfinder/src/pythonfinder/models/path.py", line 547, in find_all_python_versions
values = list(self.get_pythons(sub_finder))
File "…/Vcs/pythonfinder/src/pythonfinder/models/path.py", line 505, in get_pythons
pythons = [entry for entry in self._get_all_pythons(finder)]
File "…/Vcs/pythonfinder/src/pythonfinder/models/path.py", line 505, in <listcomp>
pythons = [entry for entry in self._get_all_pythons(finder)]
File "…/Vcs/pythonfinder/src/pythonfinder/models/path.py", line 498, in _get_all_pythons
for python in self._filter_paths(finder):
File "…/Vcs/pythonfinder/src/pythonfinder/models/path.py", line 490, in _filter_paths
python_versions = finder(path)
File "…/Vcs/pythonfinder/src/pythonfinder/models/mixins.py", line 330, in find_all_python_versions
unnested = [sub_finder(path) for path in expand_paths(self)]
File "…/Vcs/pythonfinder/src/pythonfinder/models/mixins.py", line 330, in <listcomp>
unnested = [sub_finder(path) for path in expand_paths(self)]
File "…/Vcs/pythonfinder/src/pythonfinder/utils.py", line 433, in expand_paths
for p in path.children.values():
File "…/Vcs/pythonfinder/src/pythonfinder/models/path.py", line 751, in children
for child_key, child_val in self._gen_children():
File "…/Vcs/pythonfinder/src/pythonfinder/models/path.py", line 742, in _gen_children
entry = PathEntry.create(path=child, **pass_args) # type: ignore
File "…/Vcs/pythonfinder/src/pythonfinder/models/path.py", line 782, in create
raise InvalidPythonVersion("Python interpreter does not exist: {}".format(target))
pythonfinder.exceptions.InvalidPythonVersion: Python interpreter does not exist: /home/user/bin/calm
It appears that a check for a non-existent file / danging symlink should happen in the calling code already maybe:
But then it is also not clear to me how/if that is related to the PathEntry being a root entry in the first place, i.e. take this hint with a lot of salt.. ;)
Given a dangling symlink in a
$PATH
entry you will get an error:t.py
:It appears that a check for a non-existent file / danging symlink should happen in the calling code already maybe:
pythonfinder/src/pythonfinder/models/path.py
Lines 732 to 742 in dfac150
But then it is also not clear to me how/if that is related to the PathEntry being a root entry in the first place, i.e. take this hint with a lot of salt.. ;)
(btw: this also happens with
Finder.find_python_version
as with the example in the README (https://github.com/sarugaku/pythonfinder/blob/dfac150ffeaccbcb3c2867c5429b38b568d85a8d/README.rst#usage).)The text was updated successfully, but these errors were encountered: