New submission from Egor Dranischnikow <no-...@turm-lahnstein.de>:

The C-API for Python2.7 
https://docs.python.org/2/c-api/bytearray.html#c.PyByteArray_AsString

lacks the sentence: "The returned array always has an extra null byte 
appended." which clarifies, that the returned C-string is null-terminated.

This sentence is a part of Python3-documentation: 
https://docs.python.org/3/c-api/bytearray.html#c.PyByteArray_AsString

I might be very wrong, but so far I understand the code this is the case for 
both versions, Python3 and Python2.

Probably parts of this change 
https://github.com/python/cpython/commit/0a560a11af0ccc816d1172180f44e5afb34ba600
 could be integrated in Python2.7

----------
assignee: docs@python
components: Documentation
messages: 318515
nosy: docs@python, realead
priority: normal
severity: normal
status: open
title: PyByteArray_AsString C-API description lacks the assurance, that the 
trailing null-byte is appended.
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33740>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to