-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Crash ``AstroidError: IndexError: list index out of range'' #9945
Comments
The crash persists after upgrading astroid and pylint. Package Version
----------------------------- ----------------
alabaster 0.7.16
astroid 3.3.3
asttokens 2.4.1
Babel 2.15.0
beautifulsoup4 4.12.3
black 24.4.2
build 1.2.1
cachetools 5.5.0
certifi 2024.7.4
cffi 1.16.0
chardet 5.2.0
charset-normalizer 3.3.2
cli-ui 0.17.2
click 8.1.7
colorama 0.4.6
contourpy 1.2.1
contributors-txt 1.0.0
coverage 7.6.0
cryptography 43.0.0
cycler 0.12.1
dialite 0.5.3
dill 0.3.8
distlib 0.3.8
docopt 0.6.2
docutils 0.21.2
execnet 2.1.1
filelock 3.16.1
flexx 0.8.4
fonttools 4.53.1
gitdb 4.0.11
GitPython 3.1.43
idna 3.7
imagesize 1.4.1
importlib_metadata 8.2.0
iniconfig 2.0.0
isort 5.13.2
jaraco.classes 3.4.0
jaraco.context 5.3.0
jaraco.functools 4.0.1
jedi 0.19.1
Jinja2 3.1.4
keyring 25.2.1
kiwisolver 1.4.5
Markdown 3.6
markdown-it-py 3.0.0
MarkupSafe 2.1.5
matplotlib 3.9.1
mccabe 0.7.0
mdurl 0.1.2
meta 1.0.2
more-itertools 10.3.0
mypy 1.11.0
mypy-extensions 1.0.0
nh3 0.2.18
numpy 2.0.1
packaging 24.1
parso 0.8.4
pathspec 0.12.1
pillow 10.4.0
pip 24.2
pkginfo 1.10.0
platformdirs 4.2.2
pluggy 1.5.0
pscript 0.7.7
py 1.11.0
py-cpuinfo 9.0.0
pycparser 2.22
pyenchant 3.2.2
pyflakes 3.2.0
Pygments 2.18.0
pylint 3.3.0
pyparsing 3.1.2
pyproject-api 1.8.0
pyproject_hooks 1.1.0
PyQt6 6.7.1
PyQt6-QScintilla 2.14.1
PyQt6-Qt6 6.7.2
PyQt6_sip 13.8.0
PyQt6-WebEngine 6.7.0
PyQt6-WebEngine-Qt6 6.7.2
PyQt6-WebEngineSubwheel-Qt6 6.7.2
pytest 8.3.2
pytest-benchmark 4.0.0
pytest-cov 5.0.0
pytest-timeout 2.3.1
pytest-xdist 3.6.1
python-dateutil 2.9.0.post0
pywin32-ctypes 0.2.2
readme_renderer 44.0
requests 2.32.3
requests-toolbelt 1.0.0
rfc3986 2.0.0
rich 13.7.1
ruff 0.5.5
schema 0.7.7
Send2Trash 1.8.3
setuptools 75.1.0
six 1.16.0
smmap 5.0.1
snowballstemmer 2.2.0
soupsieve 2.5
Sphinx 7.4.7
sphinxcontrib-applehelp 1.0.8
sphinxcontrib-devhelp 1.0.6
sphinxcontrib-htmlhelp 2.0.6
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.8
sphinxcontrib-serializinghtml 1.1.10
tabulate 0.8.10
tbump 6.11.0
tk 0.1.0
tomlkit 0.11.8
tornado 6.4.1
towncrier 24.8.0
tox 4.20.0
twine 5.1.1
types-docutils 0.21.0.20240724
types-Markdown 3.6.0.20240316
types-paramiko 3.4.0.20240423
types-pkg-resources 0.1.3
types-PyYAML 6.0.12.20240724
types-requests 2.32.0.20240712
types-six 1.16.21.20240513
typing_extensions 4.12.2
Unidecode 1.3.8
urllib3 2.2.2
virtualenv 20.26.5
webruntime 0.5.8
windows-curses 2.3.3
zipp 3.19.2 |
Reverting to pylint 3.2.7 solves the problem: pip install --force-reinstall -v "pylint==3.2.7" None of the following work for me: pip install --force-reinstall -v "astroid==3.3.0"
pip install --force-reinstall -v "astroid==3.3.3"
pip install --force-reinstall -v "pylint==3.3.0"
pip install --force-reinstall -v "pylint==3.3.3" |
Reproducing example: class A:
def f(self):
return f"{self.x:}" Another: class A:
@staticmethod
def f(x):
return f"{x:}" |
@nickdrozd Thanks for the short examples! |
Perhaps the smallest reproducer of all: _ = f"{x:}" |
@nickdrozd Thanks for the quick work! Removing the empty format specifiers (they were unintentional cruft) allows pylint handles all of Leo's source without crashing. pylint 3.3.0
astroid 3.3.3
Python 3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:03:39) [MSC v.1935 64 bit (AMD64)] |
Bug description
Crash when running pylint on
leo/core/leoGlobals.py
andleo\core\leoAst.py
.The files are too long to give here. You can find them both at
https://github.com/leo-editor/leo-editor/blob/devel/leo/core.
All Leo files are covered by the MIT license.
Configuration
C:\Users\Dev\.leo\.pylintrc
available upon request.Command used
Equivalent to:
Pylint output
Expected behavior
No crash
Pylint version
OS / Environment
The text was updated successfully, but these errors were encountered: