-
-
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
Pylint crash when it imports module dkim "KeyError: <class '_ast.Sub'>" #3540
Labels
Comments
PCManticore
added a commit
to pylint-dev/astroid
that referenced
this issue
Apr 29, 2020
When a file contained a misplaced type annotation, we were retrying the parsing without type comments support. That second parsing was using the builtin ast module, but the rest of the tree utilities (the builder and rebuilder) were not aware of the new parsing module that was used to build the AST nodes a second time. This commit moves the logic of picking the parsing module and the corresponding AST node mapping in a single place, which can be used by both the builder and the rebuilder. Close pylint-dev/pylint#3540 Close #773
PCManticore
added a commit
to pylint-dev/astroid
that referenced
this issue
Apr 29, 2020
When a file contained a misplaced type annotation, we were retrying the parsing without type comments support. That second parsing was using the builtin ast module, but the rest of the tree utilities (the builder and rebuilder) were not aware of the new parsing module that was used to build the AST nodes a second time. This commit moves the logic of picking the parsing module and the corresponding AST node mapping in a single place, which can be used by both the builder and the rebuilder. Close pylint-dev/pylint#3540 Close #773
Thanks for the report! This should already be fixed in the 2.4 and master branches on astroid. Please give it a go and let us know if you encounter any issues. We'll release the fix as astroid 2.4.1 in a couple of days. |
Indeed I can confirm it works with the latest 2.4 version of astroid. Thank you for the quick fix! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I have recently encounter this strange behavior on our tests. I have boiled it down to an issue with a module named
dkimpy
. However, I don't understand what is the issue and why an import would crash pylint. It seems to be linked to the new version ofpylint
Even if I am experiencing some issues with pylint today, I would like to thank you for this wonderful and useful piece of software.
Steps to reproduce
pip install pylint astroid --pre -U
pip install pylint
test.py
:pylint test.py
Notes
test.py
can be executed without issue (of course, it outputs nothing)Current behavior
It crashes with this error:
Expected behavior
It should not crash. If there is a problem with import, it should deliver an understandable message.
pylint --version output
The text was updated successfully, but these errors were encountered: