Skip to content

Handle parser stack overflows more gracefully #22930

@MeGaGiGaGon

Description

@MeGaGiGaGon

Summary

Currently, if you have a file that causes a stack overflow in the parser ruff/ty will crash with the usual message thread 'main' (...) has overflowed its stack. It would be nice if there was a better/more clear error when that happens, to differentiate logic-based errors in ruff/ty from "your file is too big/complex" errors.

Version

ruff 0.14.14 (8b2e7b3 2026-01-22) / ty 0.0.14 (16597f5e2 2026-01-26)

Metadata

Metadata

Assignees

No one assigned

    Labels

    parserRelated to the parser

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions