diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2021-10-14 10:17:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-14 10:17:00 (GMT) |
commit | c96d1546b11b4c282a7e21737cb1f5d16349656d (patch) | |
tree | 5e6e49378a4207591316f08e6b7fd42d4e3ff40c /Parser | |
parent | e71662c1ae817e728233ce93882c5b20f4c31ebc (diff) | |
download | cpython-c96d1546b11b4c282a7e21737cb1f5d16349656d.zip cpython-c96d1546b11b4c282a7e21737cb1f5d16349656d.tar.gz cpython-c96d1546b11b4c282a7e21737cb1f5d16349656d.tar.bz2 |
bpo-45461: Fix IncrementalDecoder and StreamReader in the "unicode-escape" codec (GH-28939)
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.
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/string_parser.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Parser/string_parser.c b/Parser/string_parser.c index cffe24e..c6fe99c 100644 --- a/Parser/string_parser.c +++ b/Parser/string_parser.c @@ -115,7 +115,7 @@ decode_unicode_with_escapes(Parser *parser, const char *s, size_t len, Token *t) 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(parser, *first_invalid_escape, t) < 0) { |