Closed hnhegde closed 2 years ago
Thanks for the report. We may need to add a wider catch to is_namespace
in astroid
.
It would be of tremendous help if you could reproduce against astroid 2.12.11
or astroid main branch, both of which have changes to the is_namespace
method.
Also, do you have any namespace packages or other directories that are called decouple
?
The failure point in the stacktrace looks very similar to the one described in python/cpython#93334, except that it's AttributeError
instead of KeyError
. I'm wondering if https://github.com/python/cpython/pull/98100 would resolve the root issue in importlib
, but I know that's a lot to ask of a bug reporter, feel free to just answer my first question about astroid versions :-)
Checked against astroid==2.12.11
. Same issue.
Reg. decouple
, I couldn't identify the root cause. There was this SO thread that said:
You might have decouple installed in additional to python-decouple (two different packages).
But, I confirmed that's not the case with me.
Bug description
The crash gets triggered by any file that contains:
I am using
python-decouple
version 3.6.pylint crashed with a
AstroidError
and with the following stacktrace:. ***** Module square-deal-services.square_deal_app.api.views.leads_api square_deal_app/api/views/leads_api.py:1:0: F0002: square_deal_app/api/views/leads_api.py: Fatal error while checking 'square_deal_app/api/views/leads_api.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in '/root/.cache/pylint/pylint-crash-2022-10-10-08-57-37.txt'. (astroid-error)
Configuration
No response
Command used
Pylint output
OS / Environment
Ubuntu
Additional dependencies