You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mypy will crash when creating a TypedDict using keyword unpacking on a loaded JSON-encoded dictionary when also generating reports. In our case, it happens when --cobertura-xml-report option is used.
Traceback
Traceback (most recent call last):
File "PATH/.nox/mypy-3-11/bin/mypy", line 8, in <module>
sys.exit(console_entry())
File "mypy/build.py", line 2069, in wrap_context
File "mypy/build.py", line 2405, in finish_passes
File "mypy/build.py", line 872, in report_file
File "mypy/report.py", line 91, in file
File "mypy/report.py", line 632, in on_file
File "mypy/nodes.py", line 377, in accept
File "mypy/stats.py", line 119, in visit_mypy_file
File "mypy/traverser.py", line 114, in visit_mypy_file
File "mypy/nodes.py", line 1309, in accept
File "mypy/stats.py", line 218, in visit_assignment_stmt
File "mypy/traverser.py", line 164, in visit_assignment_stmt
File "mypy/nodes.py", line 1903, in accept
File "mypy/stats.py", line 255, in visit_call_expr
File "mypy/stats.py", line 264, in record_call_target_precision
File "mypy/stats.py", line 278, in record_callable_target_precision
File "mypy/argmap.py", line 130, in map_formals_to_actuals
File "mypy/argmap.py", line 84, in map_actuals_to_formals
File "mypy/stats.py", line 283, in <lambda>
KeyError: <mypy.nodes.CallExpr object at 0x1147d3400>
FILENAME: : note: use --pdb to drop into pdb
Generated Cobertura report: PATH/reports/cobertura.xml
Fixes#16107Fixes#15891
I only vaguely remember why I added those context managers, it seemed to
me giving full TypedDict as context may cause false positives. But since
the current way causes crashes, let's just not do this (we will see if
there will be actual false positives).
Crash Report
Mypy will crash when creating a
TypedDict
using keyword unpacking on a loaded JSON-encoded dictionary when also generating reports. In our case, it happens when--cobertura-xml-report
option is used.Traceback
To Reproduce
Your Environment
--no-namespace-packages --strict-equality --no-implicit-optional --show-error-codes --warn-redundant-casts --warn-unused-ignores --warn-unused-configs --strict-equality --extra-checks --check-untyped-defs --cobertura-xml-report=PATH_TO_REPORTS
mypy.ini
(and other config files): NoneThe text was updated successfully, but these errors were encountered: