summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/bytes.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/c-api/bytes.rst')
-rw-r--r--Doc/c-api/bytes.rst6
1 files changed, 5 insertions, 1 deletions
diff --git a/Doc/c-api/bytes.rst b/Doc/c-api/bytes.rst
index 23b7128..dcd7088 100644
--- a/Doc/c-api/bytes.rst
+++ b/Doc/c-api/bytes.rst
@@ -158,7 +158,7 @@ called with a non-bytes parameter.
If *length* is *NULL*, the bytes object
may not contain embedded null bytes;
- if it does, the function returns ``-1`` and a :exc:`TypeError` is raised.
+ if it does, the function returns ``-1`` and a :exc:`ValueError` is raised.
The buffer refers to an internal buffer of *obj*, which includes an
additional null byte at the end (not counted in *length*). The data
@@ -167,6 +167,10 @@ called with a non-bytes parameter.
*obj* is not a bytes object at all, :c:func:`PyBytes_AsStringAndSize`
returns ``-1`` and raises :exc:`TypeError`.
+ .. versionchanged:: 3.5
+ Previously, :exc:`TypeError` was raised when embedded null bytes were
+ encountered in the bytes object.
+
.. c:function:: void PyBytes_Concat(PyObject **bytes, PyObject *newpart)