-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
'list' object has no attribute 'is_python' error when run from python terminal/script #85
Comments
@rbpatt2019 Would you bother to test against |
Just tested against the branch. Unfortunately, not a fix! But here's some updates:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/pattersonrb/projects/pythonfinder/src/pythonfinder/pythonfinder.py", line 323, in find_all_python_versions
major=major, minor=minor, patch=patch, pre=pre, dev=dev, arch=arch, name=name
File "/Users/pattersonrb/projects/pythonfinder/src/pythonfinder/models/path.py", line 548, in find_all_python_versions
values = list(self.get_pythons(sub_finder))
File "/Users/pattersonrb/projects/pythonfinder/src/pythonfinder/models/path.py", line 506, in get_pythons
pythons = [entry for entry in self._get_all_pythons(finder)]
File "/Users/pattersonrb/projects/pythonfinder/src/pythonfinder/models/path.py", line 506, in <listcomp>
pythons = [entry for entry in self._get_all_pythons(finder)]
File "/Users/pattersonrb/projects/pythonfinder/src/pythonfinder/models/path.py", line 499, in _get_all_pythons
for python in self._filter_paths(finder):
File "/Users/pattersonrb/projects/pythonfinder/src/pythonfinder/models/path.py", line 491, in _filter_paths
python_versions = finder(path)
File "/Users/pattersonrb/projects/pythonfinder/src/pythonfinder/models/python.py", line 288, in find_all_python_versions
pythons = list(unnest(sub_finder(path) for path in self.paths))
File "/Users/pattersonrb/projects/pythonfinder/src/pythonfinder/utils.py", line 339, in unnest
for sub in unnest(el_copy):
File "/Users/pattersonrb/projects/pythonfinder/src/pythonfinder/utils.py", line 339, in unnest
for sub in unnest(el_copy):
File "/Users/pattersonrb/projects/pythonfinder/src/pythonfinder/utils.py", line 339, in unnest
for sub in unnest(el_copy):
[Previous line repeated 977 more times]
File "/Users/pattersonrb/projects/pythonfinder/src/pythonfinder/utils.py", line 331, in unnest
if isinstance(item, Iterable) and not isinstance(item, six.string_types):
File "/Users/pattersonrb/.pyenv/versions/3.7.7/lib/python3.7/abc.py", line 139, in __instancecheck__
return _abc_instancecheck(cls, instance)
RecursionError: maximum recursion depth exceeded in comparison
[PathEntry(path=PosixPath('/Users/pattersonrb/.pyenv/versions/3.8.2/bin/python3'), _children={'/Users/pattersonrb/.pyenv/versions/3.8.2/bin/python3': ...}, only_python=False, name='3.8.2', _py_version=PythonVersion(major=3, minor=8, patch=2, is_prerelease=False, is_postrelease=False, is_devrelease=False, is_debug=False, version=<Version('3.8.2')>, architecture=None, comes_from=..., executable='/Users/pattersonrb/.pyenv/versions/3.8.2/bin/python3', company=None, name='3.8.2'), _pythons=defaultdict(None, {}), _is_dir=False, _is_executable=True, _is_python=True, is_root=False), PathEntry(path=PosixPath('/Users/pattersonrb/.pyenv/versions/3.7.7/envs/test/bin/python3'), _children={'/Users/pattersonrb/.pyenv/versions/3.7.7/envs/test/bin/python3': ...}, only_python=False, name='python3', _py_version=PythonVersion(major=3, minor=7, patch=7, is_prerelease=False, is_postrelease=False, is_devrelease=False, is_debug=False, version=<Version('3.7.7')>, architecture=None, comes_from=..., executable='/Users/pattersonrb/.pyenv/versions/3.7.7/envs/test/bin/python3', company=None, name='python3'), _pythons=defaultdict(None, {}), _is_dir=False, _is_executable=True, _is_python=True, is_root=False), PathEntry(path=PosixPath('/Users/pattersonrb/.pyenv/versions/3.7.7/envs/test/bin/python3.7'), _children={'/Users/pattersonrb/.pyenv/versions/3.7.7/envs/test/bin/python3.7': ...}, only_python=False, name='python3.7', _py_version=PythonVersion(major=3, minor=7, patch=7, is_prerelease=False, is_postrelease=False, is_devrelease=False, is_debug=False, version=<Version('3.7.7')>, architecture=None, comes_from=..., executable='/Users/pattersonrb/.pyenv/versions/3.7.7/envs/test/bin/python3.7', company=None, name='python3.7'), _pythons=defaultdict(None, {}), _is_dir=False, _is_executable=True, _is_python=True, is_root=False), PathEntry(path=PosixPath('/Users/pattersonrb/.pyenv/versions/test/bin/python3'), _children={'/Users/pattersonrb/.pyenv/versions/test/bin/python3': ...}, only_python=False, name='python3', _py_version=PythonVersion(major=3, minor=7, patch=7, is_prerelease=False, is_postrelease=False, is_devrelease=False, is_debug=False, version=<Version('3.7.7')>, architecture=None, comes_from=..., executable='/Users/pattersonrb/.pyenv/versions/test/bin/python3', company=None, name='python3'), _pythons=defaultdict(None, {}), _is_dir=False, _is_executable=True, _is_python=True, is_root=False), PathEntry(path=PosixPath('/Users/pattersonrb/.pyenv/versions/test/bin/python3.7'), _children={'/Users/pattersonrb/.pyenv/versions/test/bin/python3.7': ...}, only_python=False, name='python3.7', _py_version=PythonVersion(major=3, minor=7, patch=7, is_prerelease=False, is_postrelease=False, is_devrelease=False, is_debug=False, version=<Version('3.7.7')>, architecture=None, comes_from=..., executable='/Users/pattersonrb/.pyenv/versions/test/bin/python3.7', company=None, name='python3.7'), _pythons=defaultdict(None, {}), _is_dir=False, _is_executable=True, _is_python=True, is_root=False), PathEntry(path=PosixPath('/Users/pattersonrb/.pyenv/versions/3.7.7/bin/python3'), _children={'/Users/pattersonrb/.pyenv/versions/3.7.7/bin/python3': ...}, only_python=False, name='3.7.7', _py_version=PythonVersion(major=3, minor=7, patch=7, is_prerelease=False, is_postrelease=False, is_devrelease=False, is_debug=False, version=<Version('3.7.7')>, architecture=None, comes_from=..., executable='/Users/pattersonrb/.pyenv/versions/3.7.7/bin/python3', company=None, name='3.7.7'), _pythons=defaultdict(None, {}), _is_dir=False, _is_executable=True, _is_python=True, is_root=False), PathEntry(path=PosixPath('/Users/pattersonrb/.pyenv/versions/test/bin/python3'), _children={'/Users/pattersonrb/.pyenv/versions/test/bin/python3': ...}, only_python=False, name='test', _py_version=PythonVersion(major=3, minor=7, patch=7, is_prerelease=False, is_postrelease=False, is_devrelease=False, is_debug=False, version=<Version('3.7.7')>, architecture=None, comes_from=..., executable='/Users/pattersonrb/.pyenv/versions/test/bin/python3', company=None, name='test'), _pythons=defaultdict(None, {}), _is_dir=False, _is_executable=True, _is_python=True, is_root=False), PathEntry(path=PosixPath('/usr/bin/python3'), _children={'/usr/bin/python3': ...}, only_python=False, name='python3', _py_version=PythonVersion(major=3, minor=7, patch=3, is_prerelease=False, is_postrelease=False, is_devrelease=False, is_debug=False, version=<Version('3.7.3')>, architecture=None, comes_from=..., executable='/usr/bin/python3', company=None, name='python3'), _pythons=defaultdict(None, {}), _is_dir=False, _is_executable=True, _is_python=True, is_root=False), PathEntry(path=PosixPath('/usr/bin/python2'), _children={'/usr/bin/python2': ...}, only_python=False, name='python2', _py_version=PythonVersion(major=2, minor=7, patch=16, is_prerelease=False, is_postrelease=False, is_devrelease=False, is_debug=False, version=<Version('2.7.16')>, architecture=None, comes_from=..., executable='/usr/bin/python2', company=None, name='python2'), _pythons=defaultdict(None, {}), _is_dir=False, _is_executable=True, _is_python=True, is_root=False), PathEntry(path=PosixPath('/usr/bin/python2.7'), _children={'/usr/bin/python2.7': ...}, only_python=False, name='python2.7', _py_version=PythonVersion(major=2, minor=7, patch=16, is_prerelease=False, is_postrelease=False, is_devrelease=False, is_debug=False, version=<Version('2.7.16')>, architecture=None, comes_from=..., executable='/usr/bin/python2.7', company=None, name='python2.7'), _pythons=defaultdict(None, {}), _is_dir=False, _is_executable=True, _is_python=True, is_root=False)] Seems that specifying a major/minor version is throwing the bug! Hope this helps. Appreciate all the help! |
Finally reproduced in one of the test cases, can you please try again? |
That did the trick! Running from the terminal works (as always), and now it works in a python terminal, both with and without specifying the version. I can either close this now, or you can when Cheers! |
Great, I am merging it. |
See here as well.
Basically, the below errors:
But the following works as expected:
I suspect this is related to #24 but am surprised to see that the error when run in a python prompt/script, as the CLI works fine!
The text was updated successfully, but these errors were encountered: