Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
ghost
force-pushed
the
fix-gh-153837-tokenize-indent-offset
branch
2 times, most recently
from
July 20, 2026 18:36
1f9d26c to
55ff05e
Compare
…dentation error, not end of line
ghost
force-pushed
the
fix-gh-153837-tokenize-indent-offset
branch
from
July 20, 2026 20:04
55ff05e to
fc1b106
Compare
Repository owner
closed this by deleting the head repository
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since Python 3.12 (PEP 701 refactoring), the module reports incorrect column offsets on and related indentation errors. The function in unconditionally used (the end of the current line) as the column offset, producing an offset equal to the line length rather than pointing to where the indentation error actually occurs.
For indentation errors (
E_DEDENT,E_TABSPACE,E_TOODEEP), this fix computes the offset by scanning from the start of the line to the first non-whitespace character, which is where the indentation error is detected. This restores the correct behavior that existed in Python 3.11 and earlier, where the offset pointed to the problematic indentation rather than the end of the line.e.offsetonIndentationErroris not set correctly #153837