[docs] Document that PyUnicode_AsUTF8() returns a null-terminated string (issue 23088)

storchaka at gmail.com storchaka at gmail.com
Sat Mar 21 09:12:16 CET 2015


I can't make a decision about the patch for this issue, you should ask
other developer for the review. I can only make formal notes and ask
questions.


https://bugs.python.org/review/23088/diff/14165/Doc/c-api/bytes.rst
File Doc/c-api/bytes.rst (right):

https://bugs.python.org/review/23088/diff/14165/Doc/c-api/bytes.rst#newcode158
Doc/c-api/bytes.rst:158: If *length* is *NULL*, the string may not
contain embedded null characters;
I think it is better to avoid words "string" (except may be a
combination "byte string") and "character" when say about the content of
a bytes object.

This documentation is mainly a copy of the documentation of Python 2
strings, and contains outdated and incorrect wording. It would be good
to fix this, but may be in other issue.

https://bugs.python.org/review/23088/diff/14165/Doc/c-api/unicode.rst
File Doc/c-api/unicode.rst (right):

https://bugs.python.org/review/23088/diff/14165/Doc/c-api/unicode.rst#newcode230
Doc/c-api/unicode.rst:230: The returned buffer is always terminated with
an extra null character,
May be the wording used in PyUnicode_AsUnicode,
PyUnicode_AsUnicodeAndSize, and PyUnicode_AsWideCharString looks
cleaner?

https://bugs.python.org/review/23088/diff/14165/Doc/c-api/unicode.rst#newcode233
Doc/c-api/unicode.rst:233: The *o* argument has to be a Unicode object
(not checked).
argument or parameter? What is correct?

https://bugs.python.org/review/23088/


More information about the docs mailing list