Skip to content

gh-116042: Fix location for SyntaxErrors of invalid escapes in the tokenizer #116049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

pablogsal
Copy link
Member

@pablogsal pablogsal commented Feb 28, 2024

Copy link
Member

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

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

One nitty comment. Feel free to ignore.

@Privat33r-dev
Copy link
Contributor

Privat33r-dev commented Mar 12, 2024

When excessive quotes are present, the error highlight has offset. I suggest to add this test-case as well.

    "''Incorrect \ logic?"
                   ^^
SyntaxError: invalid escape sequence '\ '

and

    "'''''''''''''''''''''invalid\ Escape"
                                          ^
SyntaxError: invalid escape sequence '\ '

while it works well with single and multiple normal quotes

    "Incorrect \ logic?"
               ^^
SyntaxError: invalid escape sequence '\ '

@pablogsal pablogsal enabled auto-merge (squash) February 13, 2025 00:44
@pablogsal pablogsal added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Feb 13, 2025
@pablogsal pablogsal merged commit 56eda25 into python:main Feb 13, 2025
46 checks passed
@pablogsal pablogsal deleted the fixes branch February 13, 2025 01:07
@miss-islington-app
Copy link

Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @pablogsal, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 56eda256336310a08d4beb75b998488cb359444b 3.13

@miss-islington-app
Copy link

Sorry, @pablogsal, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 56eda256336310a08d4beb75b998488cb359444b 3.12

pablogsal added a commit to pablogsal/cpython that referenced this pull request Feb 13, 2025
…pes in the tokenizer (pythonGH-116049)

(cherry picked from commit 56eda25)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Feb 13, 2025

GH-130065 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Feb 13, 2025
@bedevere-app
Copy link

bedevere-app bot commented Feb 13, 2025

GH-130066 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Feb 13, 2025
pablogsal added a commit to pablogsal/cpython that referenced this pull request Feb 13, 2025
…pes in the tokenizer (pythonGH-116049)

(cherry picked from commit 56eda25)
(cherry picked from commit 369704b)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
pablogsal added a commit that referenced this pull request Feb 13, 2025
pablogsal added a commit that referenced this pull request Feb 13, 2025
… the tokenizer (GH-116049) (#130066)

(cherry picked from commit 56eda25)
(cherry picked from commit 369704b)
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.

4 participants