Message266142
Hi,
is there any reason why ord() raises a TypeError instead of ValueError on string/bytes input with wrong length?
The chr() function will raise a ValueError on negative integers such as chr(-1).
Required behaviour:
try:
n = ord(input_string)
except ValueError as e:
# it's a string/bytes-string, process potential escape sequence and
# get an ordinal number of decoded escape sequence, otherwise raise
...
with kind regards,
Chris |
|
Date |
User |
Action |
Args |
2016-05-23 12:53:59 | cwr | set | recipients:
+ cwr, vstinner, ezio.melotti |
2016-05-23 12:53:59 | cwr | set | messageid: <1464008039.38.0.432855281585.issue27092@psf.upfronthosting.co.za> |
2016-05-23 12:53:59 | cwr | link | issue27092 messages |
2016-05-23 12:53:59 | cwr | create | |
|