Skip to content

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

Merged
pablogsal merged 3 commits into
python:mainfrom
mdboom:multiline-decode-error
Sep 6, 2022
Merged

pablogsal merged 3 commits into
python:mainfrom
mdboom:multiline-decode-error

Conversation

@mdboom

@mdboom mdboom commented Sep 6, 2022 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

Great catch!

@mdboom

mdboom commented Sep 6, 2022

Copy link
Copy Markdown
Contributor Author

Great catch!

Yeah, thanks to @polprog for finding it!

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

Copy link
Copy Markdown
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
Copy Markdown

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

@bedevere-bot

Copy link
Copy Markdown

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