Skip to content
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

gh-96611: Fix error message for invalid UTF-8 in mid-multiline string #96623

Merged
merged 3 commits into from
Sep 6, 2022

Conversation

mdboom
Copy link
Contributor

@mdboom mdboom commented Sep 6, 2022

This now emits:

SyntaxError: Non-UTF-8 code starting with '\xb1' in file /home/mdboom/tmp/x.py on line 3, but no encoding declared; see https://peps.python.org/pep-0263/ for details

rather than

SystemError: Negative size passed to PyUnicode_New

Automerge-Triggered-By: GH:pablogsal

@pablogsal
Copy link
Member

Great catch!

@mdboom
Copy link
Contributor Author

mdboom commented Sep 6, 2022

Great catch!

Yeah, thanks to @polprog for finding it!

@pablogsal pablogsal merged commit 05692c6 into python:main Sep 6, 2022
@miss-islington
Copy link
Contributor

Thanks @mdboom for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 6, 2022
…string (pythonGH-96623)

(cherry picked from commit 05692c6)

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Sep 6, 2022
@bedevere-bot
Copy link

GH-96631 is a backport of this pull request to the 3.11 branch.

@bedevere-bot
Copy link

GH-96632 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 Sep 6, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 6, 2022
…string (pythonGH-96623)

(cherry picked from commit 05692c6)

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
miss-islington added a commit that referenced this pull request Sep 6, 2022
…GH-96623)

(cherry picked from commit 05692c6)

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
miss-islington added a commit that referenced this pull request Sep 6, 2022
…GH-96623)

(cherry picked from commit 05692c6)

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
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