[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

Oren Milman report at bugs.python.org
Sat Aug 19 04:39:35 EDT 2017


Oren Milman added the comment:

I am not sure I understood your question, Igor.

I compiled with https://github.com/python/cpython/pull/3006, and got:
    class T(ctypes.Array):
        _type_ = ctypes.c_int
        _length_ = 2 ** 1000
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OverflowError: Python int too large to convert to C ssize_t

and also:
    class T(ctypes.Array):
        _type_ = ctypes.c_int
        _length_ = -1
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OverflowError: array too large

----------

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


More information about the Python-bugs-list mailing list