Skip to content

gh-154544: Fix TracebackException mutating attributes during formatting#154545

Open
tonghuaroot wants to merge 1 commit into
python:mainfrom
tonghuaroot:fix-traceback-keyword-typo-mutation
Open

gh-154544: Fix TracebackException mutating attributes during formatting#154545
tonghuaroot wants to merge 1 commit into
python:mainfrom
tonghuaroot:fix-traceback-keyword-typo-mutation

Conversation

@tonghuaroot

@tonghuaroot tonghuaroot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

_find_keyword_typos() mutated self.text, self.offset, self.end_offset, self.lineno, self.end_lineno, and self.msg in place, making format_exception_only() non-idempotent. Changed it to return a tuple of replacement values; _format_syntax_error() now uses local variables.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant