diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-06-11 21:50:30 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-06-11 21:50:30 (GMT) |
commit | da0eca427aef6c58f3c134c0789f54d7b8fa4210 (patch) | |
tree | 035de9f0ffe1bca76631b3459dab6dc64179ca60 /Modules | |
parent | cc0cfd357611c69a99841f21affa73e829416789 (diff) | |
download | cpython-da0eca427aef6c58f3c134c0789f54d7b8fa4210.zip cpython-da0eca427aef6c58f3c134c0789f54d7b8fa4210.tar.gz cpython-da0eca427aef6c58f3c134c0789f54d7b8fa4210.tar.bz2 |
Issue #8966: If a ctypes structure field is an array of c_char, convert its
value to bytes instead of str (as done for c_char and c_char_p).
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_ctypes/cfield.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c index 441ed9e..876e2c0 100644 --- a/Modules/_ctypes/cfield.c +++ b/Modules/_ctypes/cfield.c @@ -1333,7 +1333,7 @@ s_get(void *ptr, Py_ssize_t size) break; } - return PyUnicode_FromStringAndSize((char *)ptr, (Py_ssize_t)i); + return PyBytes_FromStringAndSize((char *)ptr, (Py_ssize_t)i); } static PyObject * |