Skip to content

IndexError: list index out of range #16674

Closed as duplicate of#19014
Closed as duplicate of#19014
@joshvoigts

Description

@joshvoigts

Crash Report

Mypy crashes when run on a python repo with mypy .

Traceback

error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 1.7.1
Traceback (most recent call last):
  File "mypy/checkexpr.py", line 5727, in accept
  File "mypy/nodes.py", line 2211, in accept
  File "mypy/checkexpr.py", line 5202, in visit_lambda_expr
  File "mypy/nodes.py", line 2204, in expr
IndexError: list index out of range

To Reproduce

Run mypy . on our private repo. It seems to fail on a particular python file giving -1 as the line number.

Your Environment

  • Mypy version used: 1.4.1 and 1.7.1 both seem to crash.
  • Mypy command-line flags: n/a
  • Mypy configuration options from mypy.ini (and other config files):
[tool.mypy]
disallow_incomplete_defs = true

no_incremental = true

plugins = "sqlalchemy.ext.mypy.plugin"

warn_redundant_casts = true
warn_unreachable = true
warn_unused_ignores = true

[[tool.mypy.overrides]]
module = "flask_sqlalchemy"
ignore_missing_imports = true
  • Python version used: 3.9.11
  • Operating system and version: macos 14.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions