[New-bugs-announce] [issue29834] Raise ValueError rather of OverflowError in PyLong_AsUnsignedLong()

Serhiy Storchaka report at bugs.python.org
Fri Mar 17 04:44:59 EDT 2017


New submission from Serhiy Storchaka:

OverflowError is raised when Python integer doesn't fit in C integer type due to platform limitations. Different platforms have different limits. But in PyLong_AsUnsignedLong() only the upper limit is platform-depended. Negative integers always are not accepted. PyLong_AsUnsignedLong() is used for values that can be only non-negative. I think that ValueError is more appropriate in this case than OverflowError.

----------
components: Interpreter Core
messages: 289748
nosy: Oren Milman, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Raise ValueError rather of OverflowError in PyLong_AsUnsignedLong()
type: enhancement
versions: Python 3.7

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


More information about the New-bugs-announce mailing list