-
-
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 Parsing Python code failed: expected an indented block after function definition
#6301
Comments
Unfortunately, I cannot reproduce the error. Please make sure the indentation is correct. |
The syntax is correct (Python can execute the code just fine). Did you call pylint with |
for some reason, It probably gets swallowed here: |
I can reproduce this with your specific versions of Pylint & astroid.
|
Right, upgrading |
I was able to reproduce it now. Like @mbyrnepr2 said, this is already fixed in Maybe you have an idea @DanielNoord? It seems to be related to the |
No, sorry! I have no immediate hunch for what could have been the fix (or previous bug)/ The only thing I can think of is the commenting of Sorry guys! I hoped to avoid this! 😓 |
Don't worry, as we say in some python packaging circles it's impossible to migrate to argparse without breaking a few eggs. |
@evgeni Have you checked if the problem exists when using a configuration file as well? If not I'd say we can close this issue and (sadly) accept that this might be a bug in |
Same thing with a config: % cat pylintrc
[MASTER]
ignore-imports=y
% python -m pylint ./l2.py
************* Module l2
l2.py:1:0: F0002: l2.py: Fatal error while checking 'l2.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in '/home/evgeni/.cache/pylint/pylint-crash-2022-04-15-09.txt'. (astroid-error) |
😢 Sorry, I don't really have an easy solution here. Especially since this might have happened somewhere in the middle of the 30+ PRs that were necessary to transition from |
🤗 No worries, I can just pin to <2.13 for now. For the mighty search engines: on Python 3.8 the error reads |
Btw, |
Nope, this is failing for me with % python -m pylint --version
pylint 2.13.0
astroid 2.11.2
Python 3.10.4 (main, Mar 25 2022, 00:00:00) [GCC 11.2.1 2022012
7 (Red Hat 11.2.1-9)] |
Then we might have actually fixed a bug we didn't know about by moving to I don't know any more 😅 I'm going to keep this issue open for visibility and close it as we release |
I was curious, so I bisected it. : D We have, unfortunately, two bugs where the second bug silenced the crash aspect of the first one. Bug 1: 4ca885f Bug 2: 03cfbf3 |
:-) we love testers! second issue extracted into #6350 so we can make sure to do it. thanks for getting in touch! |
@jacobtylerwalls What do you think would the best way to solve this? I was thinking maybe add an |
I'm testing a patch that inserts ": ..." so that |
pylint 2.13+ has a bug with disable=R and ignore-imports=y, which we use. See pylint-dev/pylint#6301 for details
pylint 2.13+ has a bug with disable=R and ignore-imports=y, which we use. See pylint-dev/pylint#6301 for details
Bug description
When parsing the following file:
pylint crashed with a
AstroidSyntaxError
and with the following stacktrace:If I remove the
pylint:disable=R
comment, things work as expected.If I call
pylint
without--ignore-imports=y
, things work as expected.If I downgrade
pylint
(andastroid
) to astroid-2.9.3 pylint-2.12.2, things work as expected.Configuration
No response
Command used
Pylint output
Expected behavior
no astroid error ;-)
Pylint version
OS / Environment
Fedora 35
Additional dependencies
astroid==2.11.2
dill==0.3.4
flake8==4.0.1
isort==4.3.21
lazy-object-proxy==1.7.1
mccabe==0.6.1
platformdirs==2.5.1
pycodestyle==2.8.0
pyflakes==2.4.0
pylint==2.13.5
toml==0.10.2
tomli==2.0.1
wrapt==1.13.3
The text was updated successfully, but these errors were encountered: