diff -r 4ef2404d343e Doc/c-api/arg.rst --- a/Doc/c-api/arg.rst Mon Jul 11 01:32:09 2016 +0000 +++ b/Doc/c-api/arg.rst Mon Jul 11 16:55:24 2016 +0800 @@ -60,7 +60,7 @@ A pointer to an existing string is stored in the character pointer variable whose address you pass. The C string is NUL-terminated. The Python string must not contain embedded NUL bytes; if it does, - a :exc:`TypeError` exception is raised. Unicode objects are converted + a :exc:`ValueError` exception is raised. Unicode objects are converted to C strings using ``'utf-8'`` encoding. If this conversion fails, a :exc:`UnicodeError` is raised. @@ -99,7 +99,7 @@ ``y`` (read-only :term:`bytes-like object`) [const char \*] This format converts a bytes-like object to a C pointer to a character string; it does not accept Unicode objects. The bytes buffer must not - contain embedded NUL bytes; if it does, a :exc:`TypeError` + contain embedded NUL bytes; if it does, a :exc:`ValueError` exception is raised. ``y*`` (:term:`bytes-like object`) [Py_buffer] @@ -128,7 +128,7 @@ Unicode buffer. Please note that the width of a :c:type:`Py_UNICODE` character depends on compilation options (it is either 16 or 32 bits). The Python string must not contain embedded NUL characters; if it does, - a :exc:`TypeError` exception is raised. + a :exc:`ValueError` exception is raised. .. note:: Since ``u`` doesn't give you back the length of the string, and it diff -r 4ef2404d343e Doc/c-api/bytes.rst --- a/Doc/c-api/bytes.rst Mon Jul 11 01:32:09 2016 +0000 +++ b/Doc/c-api/bytes.rst Mon Jul 11 16:55:24 2016 +0800 @@ -158,7 +158,7 @@ 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