This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ukl
Recipients ukl
Date 2018-01-17.14:32:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1516199526.4.0.467229070634.issue32582@psf.upfronthosting.co.za>
In-reply-to
Content
Hello,

the description for chr (from https://docs.python.org/3/library/functions.html#chr) reads as:

        Return the string representing a character whose Unicode code
        point is the integer i. [...] The valid range for the argument
        is from 0 through 1,114,111 (0x10FFFF in base 16). ValueError
        will be raised if i is outside that range.

If however a value > 0x7fffffff (or < -0x80000000) is provided, the function raises an Overflow error:

        $ python3 -c 'print(chr(0x80000000))'
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
        OverflowError: signed integer is greater than maximum

This is either a documentation problem or (more like) an implementation issue. I attached a patch that fixes the issue for me. (I'm not sure however if I should call PyErr_Clear() before raising ValueError.)
History
Date User Action Args
2018-01-17 14:32:06uklsetrecipients: + ukl
2018-01-17 14:32:06uklsetmessageid: <1516199526.4.0.467229070634.issue32582@psf.upfronthosting.co.za>
2018-01-17 14:32:06ukllinkissue32582 messages
2018-01-17 14:32:06uklcreate