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

Igor report at bugs.python.org
Sat Aug 19 19:17:48 EDT 2017


Igor added the comment:

Oren,

1) I might be completely wrong, but, personally, I think about OverflowError vs ValueError difference like this: if the value couldn't be handled because method's logic cannot handle it - it's a ValueError; if it could not be handled because of a low-level platform-dependent limitation - it's an OverflowError. Before that PR, the _length_ maximum value was hard-coded in the method itself, thus one might say that it was "a part of logic". With this PR, you just need a system with a large enough size_t. 
(May be, after a thousand years, it would even handle 2**1000. But negative values would be still logically incorrect. Thus, I'm only talking about "too large" case.)

2) It would be much more difficult to run into this limitation in a daily practice (e.g. by passing a very long string).

----------

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


More information about the Python-bugs-list mailing list