Message346865
https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
says, for \ooo, "In a bytes literal, hexadecimal and octal escapes denote the byte with the given value. In a string literal, these escapes denote a Unicode character with the given value."
I agree that sometimes truncating an invalid integer instead of always raising ValueError is strange.
>>> ord(b'\407')
7
>>> bytes((0o407,))
...
ValueError: bytes must be in range(0, 256)
I don't know is there was an intentional back-compatibility reason for this.
Without an example of re raising, I don't understand the re complaint. |
|
Date |
User |
Action |
Args |
2019-06-28 21:04:31 | terry.reedy | set | recipients:
+ terry.reedy, ezio.melotti, mrabarnett, serhiy.storchaka, bup |
2019-06-28 21:04:31 | terry.reedy | set | messageid: <1561755871.27.0.419671095779.issue37367@roundup.psfhosted.org> |
2019-06-28 21:04:31 | terry.reedy | link | issue37367 messages |
2019-06-28 21:04:31 | terry.reedy | create | |
|