-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
version 0.930 regression: INTERNAL ERROR AttributeError: attribute 'arguments' of 'FuncDef' undefined #11899
Comments
Looks to me like it's saying your class has a method (I assume this Not sure -- does clearing the cache fix this? |
Thank you so much! Confirming. Both of the below solutions worked for me:
Thanks again. This comment was very helpful. |
Sorry I have to take workaround (2) above back. It solved the issue only for the 1st run (empty cache) If I rerun mypy, even on a fresh cache (created by mypy-0.930) I get the INTERNAL ERROR again. so the only real workaroud is (1) above: downgrade back to mypy-0.920 |
This comment has been minimized.
This comment has been minimized.
Okay, not fully minimal, but I think at least the following should get you a crash:
|
I think @hauntsaninja's bug is #7045 -- though if it's a 0.930 regression then maybe not. (why'd I remember this? Cause I noticed the |
I believe I have a small repro case for this internal crash:
Then run
I just tried with |
Minimum reproduction of issue python#11899. The second iteration of that incremental test fails with: b.py:3: error: INTERNAL ERROR -- Please try using mypy master on Github: [ ... ] Dropping into pdb > mypy/messages.py(1951)pretty_callable() -> definition_args = [arg.variable.name for arg in tp.definition.arguments] (Pdb) p type(tp.definition) <class 'mypy.nodes.FuncDef'> (Pdb) p tp.definition.arguments *** AttributeError: arguments
This is a partial revert of d180456. Resolves python#11899
When FuncDef is deserialized we don't reconstruct the arguments. Previous code was deleting the attribute, leading to python#11899; instead, always set the attribute, maybe to None, and mypy can remind us to check for not None before use.
When FuncDef is deserialized we don't reconstruct the arguments. Previous code was deleting the attribute, leading to python#11899; instead, always set the attribute, maybe to None, and mypy can remind us to check for not None before use.
When FuncDef is deserialized we don't reconstruct the arguments. Previous code was deleting the attribute, leading to python#11899; instead, always set the attribute, maybe to None, and mypy can remind us to check for not None before use.
This looks like a duplicate of #11449 |
When FuncDef is deserialized we don't reconstruct the arguments. Previous code was deleting the attribute, leading to python#11899; instead, always set the attribute, maybe to None, and mypy can remind us to check for not None before use.
When FuncDef is deserialized we don't reconstruct the arguments. Previous code was deleting the attribute, leading to python#11899; instead, always set the attribute, maybe to the empty list, and get argument names from arg_names if arguments is empty.
When FuncDef is deserialized we don't reconstruct the arguments. Previous code was deleting the attribute, leading to python#11899; instead, always set the attribute, maybe to the empty list, and get argument names from arg_names if arguments is empty.
When FuncDef is deserialized we don't reconstruct the arguments. Previous code was deleting the attribute, leading to python#11899; instead, always set the attribute, maybe to the empty list, and get argument names from arg_names if arguments is empty.
Since we upgraded to mypy 0.960 over at typeshed, I now (for some reason) hit this crash every time I run |
When FuncDef is deserialized we don't reconstruct the arguments. Previous code was deleting the attribute, leading to python#11899; instead, always set the attribute, maybe to the empty list, and get argument names from arg_names if arguments is empty.
Just sharing a regression I just hit on code that used to pass mypy before.
Unfortunately, updating from git is not an option in my env.
Line 273 in source I can't fully share is the first (def) line below which is one (override) method in a big class:
Stack trace when running mypy is:
The text was updated successfully, but these errors were encountered: