summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-09-06 16:36:03 -0700
committerGitHub <noreply@github.com>2022-09-06 16:36:03 -0700
commitb6af9337163e03cc853aa15905658748abef0901 (patch)
tree29068fe420334661335e26045a054abbc59a64b7 /Parser/tokenizer.c
parentMerge remote-tracking branch 'upstream/3.10' into 3.10 (diff)
downloadcpython-b6af9337163e03cc853aa15905658748abef0901.tar.gz
cpython-b6af9337163e03cc853aa15905658748abef0901.tar.bz2
cpython-b6af9337163e03cc853aa15905658748abef0901.zip
gh-96611: Fix error message for invalid UTF-8 in mid-multiline string (GH-96623)
(cherry picked from commit 05692c67c51b78a5a5a7bb61d646519025e38015) Co-authored-by: Michael Droettboom <mdboom@gmail.com>
Diffstat (limited to 'Parser/tokenizer.c')
-rw-r--r--Parser/tokenizer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index 579474c4335..2f00d208fea 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -1965,6 +1965,8 @@ tok_get(struct tok_state *tok, const char **p_start, const char **p_end)
/* Get rest of string */
while (end_quote_size != quote_size) {
c = tok_nextc(tok);
+ if (tok->done == E_DECODE)
+ break;
if (c == EOF || (quote_size == 1 && c == '\n')) {
assert(tok->multi_line_start != NULL);
// shift the tok_state's location into