Skip to content

fix: use unambiguous punction in 'invalid escape sequence' message #26582

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
Jun 8, 2021

Conversation

nedbat
Copy link
Member

@nedbat nedbat commented Jun 7, 2021

This adds quotes around the syntax error for invalid escape sequences. This matches the messages in bytesobject.c and unicodeobject.c. My invalid escape sequence was backslash-space. This change made it easier to understand what I was being told.

@pablogsal pablogsal merged commit ffd87b7 into python:main Jun 8, 2021
@miss-islington
Copy link
Contributor

Thanks @nedbat for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 8, 2021
…ythonGH-26582)

(cherry picked from commit ffd87b7)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
@bedevere-bot
Copy link

GH-26590 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Jun 8, 2021
@pablogsal
Copy link
Member

Thanks @nedbat for the catch and the PR!

miss-islington added a commit that referenced this pull request Jun 8, 2021
…H-26582)

(cherry picked from commit ffd87b7)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
@nedbat nedbat deleted the nedbat/better-punctuation branch June 8, 2021 10:18
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.

6 participants