[issue16865] ctypes arrays >=2GB in length causes exception

Eryk Sun report at bugs.python.org
Wed May 10 07:51:15 EDT 2017


Eryk Sun added the comment:

In older versions of ctypes, before it was added to the standard library, the underlying length field was a C int, and CArrayType_new used the PyInt_AS_LONG macro. ctypes was added to the standard library in 2.5, by which time the length field is Py_ssize_t, but CArrayType_new still used the PyInt_AS_LONG macro. That's still the case in 2.7. Python 3 changed this to call PyLong_AsLongAndOverflow, but apparently Christian Heimes didn't consider fixing this properly to use Py_ssize_t:

https://hg.python.org/cpython/rev/612d8dea7f6c

David, maybe there's a workaround for your use case, if you can provide some more details.

----------
nosy: +eryksun
versions: +Python 3.5, Python 3.6, Python 3.7 -Python 3.2, Python 3.3, Python 3.4

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


More information about the Python-bugs-list mailing list