Message170827
PyArg_ParseTuple raises inconsistent overflow error messages for small integer formats. For example:
>>> import _testcapi
>>> _testcapi.getargs_b(100)
100
>>> _testcapi.getargs_b(1000)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: unsigned byte integer is greater than maximum
>>> _testcapi.getargs_b(-1000)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: unsigned byte integer is less than minimum
>>> _testcapi.getargs_b(100000000000000000000)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: Python int too large to convert to C long
>>> _testcapi.getargs_b(-100000000000000000000)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: Python int too large to convert to C long
On platforms with 32-bit int and 64-bit long there will be more such cases. |
|
| Date |
User |
Action |
Args |
| 2012-09-20 18:51:10 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka |
| 2012-09-20 18:51:10 | serhiy.storchaka | set | messageid: <[email protected]> |
| 2012-09-20 18:51:09 | serhiy.storchaka | link | issue15988 messages |
| 2012-09-20 18:51:09 | serhiy.storchaka | create | |
|