mattip added the comment: Here are updated patches for 2.7 and HEAD.
I've updated the patches for both python 2 and python 3 and addressed some of the issues here: 1. Added _ctypes_alloc_format_string_with_shape() to ctypes.h 2. Changed the buffer size calculation to 32 *ndim + 3 (for the question asked before, the 32 size is just because this was the size used before the patch....) 3. Changed the sprintf to use the macro: sprintf(buf, "%"PY_FORMAT_SIZE_T"d,", shape[k]); I really hope this patch makes it to 2.7.7 and python 3 versions, as currently the situation is broken and code that once worked with older numpy versions does not work today (and we have legacy code that stopped working). ---------- nosy: +mattip versions: +Python 2.7 Added file: http://bugs.python.org/file35217/hg-python2.7-ctypes-fix-pep3118-format-strings-for-arrays-updated.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10744> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com