[issue28474] WinError(): Python int too large to convert to C long

Eryk Sun report at bugs.python.org
Fri Feb 26 15:32:21 EST 2021


Eryk Sun <eryksun at gmail.com> added the comment:

format_error() can use format "L" (long long) and then check for a value in the accepted range `value >= LONG_MIN && value <= ULONG_MAX`. If the value is out of range, raise OverflowError. Otherwise assign the value to DWORD `code`.

----------
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28474>
_______________________________________


More information about the Python-bugs-list mailing list