Skip to content

Internal error occurs at @typing.overload in large protoc generated files #22257

Open

Description

@mjohanse-emr

Crash Report

When running mypy on some large protoc generated python files, it consistently returns an internal error at the same line. Unfortunately, after mypy returns this internal error, I cannot copy the contents of the command prompt. I will paste a screenshot of the error report and traceback in the traceback section.

Traceback

Image

To Reproduce

I've attached source code to reproduce this. I was using poetry to build and run mypy, so the steps I performed are:

  • Open command prompt to the package root
  • Run poetry build && poetry install
  • Run poetry run mypy
  • See mypy take a long time and eventually fail with an internal error.

Your Environment

  • Mypy version used: 2.4.0
  • Mypy command-line flags: --show-traceback
  • Mypy configuration options from mypy.ini (and other config files): None
  • Python version used: 3.13.15
  • Operating system and version: Windows 11

Activity

  1. EmmanuelNiyonshuti commented on Oct 21, 2026

    @EmmanuelNiyonshuti
    Contributor

    I've attached source code to reproduce this.

    I'm not seeing the attached source code on the issue?

  2. mjohanse-emr commented on Oct 21, 2026

    @mjohanse-emr
    Author

    Adding attachment that I forgot on creation.

    mypy-bug-repro.zip

  3. mjohanse-emr commented on Oct 21, 2026

    @mjohanse-emr
    Author

    2. > I've attached source code to reproduce this.

    I'm not seeing the attached source code on the issue?
    

    @EmmanuelNiyonshuti sorry about that, I forgot to attach when I created. I just commented with the attachment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions