[issue32745] ctypes string pointer fields should accept embedded null characters

Eryk Sun report at bugs.python.org
Thu Feb 1 15:51:07 EST 2018


Eryk Sun <eryksun at gmail.com> added the comment:

PyUnicode_AsWideCharString was updated to raise ValueError for embedded nulls if the `size` output parameter is NULL. Z_set in cfield.c should be updated to get the size, which can be ignored here. For example:

    Py_ssize_t size; 
    buffer = PyUnicode_AsWideCharString(value, &size);

----------
nosy: +eryksun
stage:  -> test needed
type:  -> behavior
versions: +Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32745>
_______________________________________


More information about the Python-bugs-list mailing list