New submission from Serhiy Storchaka: 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. ---------- components: Interpreter Core messages: 170827 nosy: storchaka priority: low severity: normal status: open title: Inconsistency in overflow error messages of integer argument type: enhancement versions: Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15988> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com