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
"TypeError: unsupported format string passed to NoneType.__format__" while running type inference in version 2.12.x #1856
Comments
Hi @crosser, thanks for the report.
We might be able to help you distill one.
************* Module a
a.py:1:0: F0002: a.py: Fatal error while checking 'a.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in '/Users/.../Library/Caches/pylint/pylint-crash-2022-10-29-08-48-25.txt'. (astroid-error) The offending file is at the top of the crash report. If the code is too long, or contains sensitive information, you can use the knowledge that the crash happened in Doing this would be a tremendous help! |
No, not really, it does not. I am attaching a (censored) stderr from running the test. The line in the source code that apparently triggers the problem is pretty innocuous:
There is very similar property definition right before this one, that does not trigger the problem. Pylint command was
edit:
I did not provide any objects to |
Thanks for providing the traceback.
I see now that it's because you're invoking pylint from a unittest, so your test is managing the output.
The deeper failure is on the call in line 268, not the function def on line 266. Is there anything you can sanitize and tell us about line 268? Thanks again for providing the help. |
When I run pylint by hand
there is still no "Fatal error while checking ..." message in the output
Oh yes, there is a
|
Thanks, that was very helpful. Here is a reproducer: x = "{:c}".format(None) |
Steps to reproduce
I have no concise reproducer. Exception happens every time I run pylint on some internal code, with astroid 2.12.10 and 2.12.12 (debian bookworm). It does not happen with earlier versions of astroid (not with version 2.9). The pylinted code itself is "valid", it runs in production here.
Current behavior
When running pylint on some code, I get this exception:
Expected behavior
TypeError exception should not happen
python -c "from astroid import __pkginfo__; print(__pkginfo__.version)"
output2.12.10,
2.12.12
The text was updated successfully, but these errors were encountered: