[docs] [issue24823] ctypes.create_string_buffer does not add NUL if len(init) == size

Tom Pohl report at bugs.python.org
Fri Aug 7 21:54:02 CEST 2015


Tom Pohl added the comment:

If one needs to set a general buffer (i.e. not a null-terminated string buffer) one could always use:

>>> string = (ctypes.c_char*4)()
>>> string.raw = b'abcd'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24823>
_______________________________________


More information about the docs mailing list