gh-81548: Deprecate octal sequences with value larger than 0o377#91668
Conversation
|
I'm glad you're doing this! |
|
Interesting, you posted your comment just between two commits which I have pushed with one |
|
If possible, I would suggest extending the information about this deprecation warning as it is not obvious for people reading this why is this made and when does the deprecation warning fires off.
$ cat a.py
print("\407", b"\407")
$ python3.11 a.py
ć b'\x07'
$ python3.11 -W default a.py
//a.py:1: DeprecationWarning: invalid octal escape sequence '\407'
print("\407", b"\407")
//a.py:1: DeprecationWarning: invalid octal escape sequence '\407'
print("\407", b"\407")
ć b'\x07'I believe this comes from the default warning filter. Idk if we really want it described there, but imho it never hurts to provide more information. |
Will give this a go soon 👍 |
|
Closes #81548.