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

pablogsal commented Sep 6, 2022

Great catch!

@pablogsal pablogsal added awaiting review needs backport to 3.11 needs backport to 3.10 🤖 automerge PR will be merged once it's been approved and all CI passed and removed awaiting merge labels Sep 6, 2022
@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
14 checks passed
@miss-islington
Copy link
Contributor

miss-islington commented Sep 6, 2022

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 issue Sep 6, 2022
…string (pythonGH-96623)

(cherry picked from commit 05692c6)

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
@bedevere-bot
Copy link

bedevere-bot commented Sep 6, 2022

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

@bedevere-bot
Copy link

bedevere-bot commented Sep 6, 2022

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

miss-islington pushed a commit to miss-islington/cpython that referenced this issue 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 issue 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 issue 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
🤖 automerge PR will be merged once it's been approved and all CI passed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants