Eric V. Smith added the comment:
This is a FAQ:
https://docs.python.org/3/faq/design.html#why-can-t-raw-strings-r-strings-end-with-a-backslash
Raw strings can't end with an odd number of backslashes.
--
components: -Windows
nosy: +eric.smith
resolution: -> not a bug
stage: -> reso
New submission from 安迷 :
[test@test ~]# python3 -c 'print(r"\n")'
\n
[test@test ~]# python3 -c 'print(r"n\")'
File "", line 1
print(r"n\")
^
SyntaxError: EOL while scanning string literal
--
components: Windows
messages: 382785
nosy: anmikf, paul.moore, steve.dower,