Skip to content

Conversation

@pablogsal
Copy link
Member

@pablogsalpablogsal commented Dec 6, 2025

When a multi-line string concatenation is missing a comma before the
next argument, the error previously pointed to the first string in the
concatenation, which was confusing because the actual fix needed to be
applied after the last string. This change adds a helper function that
detects multi-line expressions and adjusts the error position to point
to the last line, making it immediately clear where the comma should be
added.

…oncatenations When a multi-line string concatenation is missing a comma before the next argument, the error previously pointed to the first string in the concatenation, which was confusing because the actual fix needed to be applied after the last string. This change adds a helper function that detects multi-line expressions and adjusts the error position to point to the last line, making it immediately clear where the comma should be added.
Copy link
Member

@lysnikolaoulysnikolaou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!

@pablogsalpablogsal merged commit c433986 into python:mainDec 11, 2025
50 checks passed
@pablogsalpablogsal deleted the gh-142236-2 branch December 11, 2025 14:47
fatelei pushed a commit to fatelei/cpython that referenced this pull request Dec 12, 2025
Sign up for freeto 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.

2 participants

@pablogsal@lysnikolaou