-
-
Notifications
You must be signed in to change notification settings - Fork 292
Some __str__
methods of nodes raise errors and warnings
#1881
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
Comments
The first issue is caused by the fact that the I ran into this while debugging |
Calling str() or repr() on certain nodes fails either with errors or warnings. This commit adds unittests to find and reproduce this behavior with the endgoal of fixing it. Related to pylint-dev#1881
I made a quick unit test on #2198. Am I going in the right direction? Also, I guess fixing the errors themselves will be part of this issue right? |
I'd prefer using I think the bigger issue is that the reliance on |
I labeled this as a good first issue because I was hoping it wasn't requiring knowledge of any of that, just placing a good blank placeholder in the str/repr when the info is not available. |
That would require a fix here: astroid/astroid/nodes/node_ng.py Line 213 in a6eb2b8
I guess that would work? We don't really need a regression test for it though (I think). |
LGTM. There are bunch of overridden |
Calling str() or repr() on certain nodes fails either with errors or warnings. A unittest was added to verify this behaviour and find the offending nodes. Code has been corrected, mainly by accesing node's attributes safely and using placeholders if necessary. Closes pylint-dev#1881
Calling str() or repr() on certain nodes fails either with errors or warnings. A unittest was added to verify this behaviour and find the offending nodes. Code has been corrected, mainly by accesing node's attributes safely and using placeholders if necessary. Closes pylint-dev#1881
Calling str() or repr() on certain nodes fails either with errors or warnings. A unittest was added to verify this behaviour and find the offending nodes. Code has been corrected, mainly by accesing node's attributes safely and using placeholders if necessary. Closes pylint-dev#1881
Calling str() or repr() on certain nodes fails either with errors or warnings. A unittest was added to verify this behaviour and find the offending nodes. Code has been corrected, mainly by accesing node's attributes safely and using placeholders if necessary. Closes pylint-dev#1881
Calling str() or repr() on certain nodes fails either with errors or warnings. A unittest was added to verify this behaviour and find the offending nodes. Code has been corrected, mainly by accesing node's attributes safely and using placeholders if necessary. Closes pylint-dev#1881
Calling str() or repr() on certain nodes fails either with errors or warnings. A unittest was added to verify this behaviour and find the offending nodes. Code has been corrected, mainly by accesing node's attributes safely and using placeholders if necessary. Closes #1881
Steps to reproduce
Less severely, but still not great, launching python with warnings e.g.
python -Wall
:We should add a unittest that generates the
str()
andrepr()
of all node types.python -c "from astroid import __pkginfo__; print(__pkginfo__.version)"
output2.12.13
The text was updated successfully, but these errors were encountered: