summaryrefslogtreecommitdiffstats
path: root/Include/cpython/unicodeobject.h
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2021-10-14 17:04:19 (GMT)
committerGitHub <noreply@github.com>2021-10-14 17:04:19 (GMT)
commit39aa98346d5dd8ac591a7cafb467af21c53f1e5d (patch)
treed363b62f299171467fce0cd3e1fe155c2ca41a09 /Include/cpython/unicodeobject.h
parentd413c503636cde2a6ab0ada25dccb0134633a8e6 (diff)
downloadcpython-39aa98346d5dd8ac591a7cafb467af21c53f1e5d.zip
cpython-39aa98346d5dd8ac591a7cafb467af21c53f1e5d.tar.gz
cpython-39aa98346d5dd8ac591a7cafb467af21c53f1e5d.tar.bz2
bpo-45467: Fix IncrementalDecoder and StreamReader in the "raw-unicode-escape" codec (GH-28944)
They support now splitting escape sequences between input chunks. Add the third parameter "final" in codecs.raw_unicode_escape_decode(). It is True by default to match the former behavior.
Diffstat (limited to 'Include/cpython/unicodeobject.h')
-rw-r--r--Include/cpython/unicodeobject.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/Include/cpython/unicodeobject.h b/Include/cpython/unicodeobject.h
index bc5a3b4..ab4aebf 100644
--- a/Include/cpython/unicodeobject.h
+++ b/Include/cpython/unicodeobject.h
@@ -796,6 +796,16 @@ PyAPI_FUNC(PyObject*) _PyUnicode_DecodeUnicodeEscapeInternal(
string. */
);
+/* --- Raw-Unicode-Escape Codecs ---------------------------------------------- */
+
+/* Variant of PyUnicode_DecodeRawUnicodeEscape that supports partial decoding. */
+PyAPI_FUNC(PyObject*) _PyUnicode_DecodeRawUnicodeEscapeStateful(
+ const char *string, /* Unicode-Escape encoded string */
+ Py_ssize_t length, /* size of string */
+ const char *errors, /* error handling */
+ Py_ssize_t *consumed /* bytes consumed */
+);
+
/* --- Latin-1 Codecs ----------------------------------------------------- */
PyAPI_FUNC(PyObject*) _PyUnicode_AsLatin1String(