summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-01-22 21:07:07 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-01-22 21:07:07 (GMT)
commit2a404b63d48d73bbaa007d89efb7a01048475acd (patch)
tree66a217f6efa01478ca1741218fb059112675b0f1 /Doc/c-api
parentd528791096694307884762eebc8ec6fed279f302 (diff)
downloadcpython-2a404b63d48d73bbaa007d89efb7a01048475acd.zip
cpython-2a404b63d48d73bbaa007d89efb7a01048475acd.tar.gz
cpython-2a404b63d48d73bbaa007d89efb7a01048475acd.tar.bz2
Issue #28769: The result of PyUnicode_AsUTF8AndSize() and PyUnicode_AsUTF8()
is now of type "const char *" rather of "char *".
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/unicode.rst10
1 files changed, 8 insertions, 2 deletions
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index a5d6c86..bcae44e 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -1038,7 +1038,7 @@ These are the UTF-8 codec APIs:
raised by the codec.
-.. c:function:: char* PyUnicode_AsUTF8AndSize(PyObject *unicode, Py_ssize_t *size)
+.. c:function:: const char* PyUnicode_AsUTF8AndSize(PyObject *unicode, Py_ssize_t *size)
Return a pointer to the UTF-8 encoding of the Unicode object, and
store the size of the encoded representation (in bytes) in *size*. The
@@ -1055,13 +1055,19 @@ These are the UTF-8 codec APIs:
.. versionadded:: 3.3
+ .. versionchanged:: 3.7
+ The return type is now ``const char *`` rather of ``char *``.
+
-.. c:function:: char* PyUnicode_AsUTF8(PyObject *unicode)
+.. c:function:: const char* PyUnicode_AsUTF8(PyObject *unicode)
As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size.
.. versionadded:: 3.3
+ .. versionchanged:: 3.7
+ The return type is now ``const char *`` rather of ``char *``.
+
.. c:function:: PyObject* PyUnicode_EncodeUTF8(const Py_UNICODE *s, Py_ssize_t size, const char *errors)