[issue27623] int.to_bytes() and int.from_bytes(): raise ValueError when bytes count is zero

Anders Lorentsen report at bugs.python.org
Fri Jul 29 20:01:18 EDT 2016


Anders Lorentsen added the comment:

I updated my patch to account for that second corner case. But ideally, shouldn't it rather be accounted for in the function that does the actual conversion, that is, in _PyLong_AsByteArray?

----------
Added file: http://bugs.python.org/file43942/int_to_bytes_overflow_cornercase2.patch

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


More information about the Python-bugs-list mailing list