Skip to content

fix: report parser errors instead of crashing with IndexError#1306

Open
SAY-5 wants to merge 1 commit into
google:mainfrom
SAY-5:fix-parse-error-msg
Open

fix: report parser errors instead of crashing with IndexError#1306
SAY-5 wants to merge 1 commit into
google:mainfrom
SAY-5:fix-parse-error-msg

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 12, 2026

When the parser raises a ParseError (for example on f-strings using PEP 701 nested quotes), FormatErrorMsg assumed a 3-tuple in e.args[1] and crashed with IndexError: tuple index out of range, masking the real error. It now handles ParseError and emits a normal YapfError with the source location. Closes #1303.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Crash][Reproducible] IndexError: tuple index out of range

1 participant