Author serhiy.storchaka
Recipients Oren Milman, rhettinger, serhiy.storchaka
Date 2017-03-18.09:01:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
_Py_Uid_Converter() in Modules/posixmodule.c is not an example because it calls PyLong_AsUnsignedLong() only for positive integers > LONG_MAX.

PyLong_AsUnsignedLong() is used not much. The motivation of this issue was that if use PyLong_AsUnsignedLong() for converting non-negative by its nature values ValueError can be more appropriate since this limitation is not platform or implementation dependent. Strictly speaking raising OverflowError for negative values doesn't fits the definition of an OverflowError, since the result is not large at all.

I was going to investigate all usages of PyLong_AsUnsignedLong() and if in majority of them ValueError is appropriate and desirable, changing the exception type at that level can make the implementation simpler.
Date User Action Args
2017-03-18 09:01:27serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, Oren Milman
2017-03-18 09:01:27serhiy.storchakasetmessageid: <>
2017-03-18 09:01:27serhiy.storchakalinkissue29834 messages
2017-03-18 09:01:27serhiy.storchakacreate