summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2021-10-14 17:03:29 (GMT)
committerGitHub <noreply@github.com>2021-10-14 17:03:29 (GMT)
commit7c722e32bf582108680f49983cf01eaed710ddb9 (patch)
tree13d1aeebf59adeadf1809387ec22f966df6e260b /Python
parent38fadbc5b9fce409af4f40a093575535709a9bb0 (diff)
downloadcpython-7c722e32bf582108680f49983cf01eaed710ddb9.zip
cpython-7c722e32bf582108680f49983cf01eaed710ddb9.tar.gz
cpython-7c722e32bf582108680f49983cf01eaed710ddb9.tar.bz2
[3.9] bpo-45461: Fix IncrementalDecoder and StreamReader in the "unicode-escape" codec (GH-28939) (GH-28945)
They support now splitting escape sequences between input chunks. Add the third parameter "final" in codecs.unicode_escape_decode(). It is True by default to match the former behavior. (cherry picked from commit c96d1546b11b4c282a7e21737cb1f5d16349656d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Python')
-rw-r--r--Python/ast.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/ast.c b/Python/ast.c
index c7ba4d9..6dd7059 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -4640,7 +4640,7 @@ decode_unicode_with_escapes(struct compiling *c, const node *n, const char *s,
s = buf;
const char *first_invalid_escape;
- v = _PyUnicode_DecodeUnicodeEscape(s, len, NULL, &first_invalid_escape);
+ v = _PyUnicode_DecodeUnicodeEscapeInternal(s, len, NULL, NULL, &first_invalid_escape);
if (v != NULL && first_invalid_escape != NULL) {
if (warn_invalid_escape_sequence(c, n, *first_invalid_escape) < 0) {