cfgbd added the comment:
Thanks for comment. Here I got my answer from string docs.
Even in a raw literal, quotes can be escaped with a backslash, but the
backslash remains in the result; for example, r"\"" is a valid string literal
consisting of two characters: a backslash and
New submission from cfgbd:
In python shell, I typed words and got result as follows. It seems that the use
of 'r' before a literal string may cause an error that the an odd '\' at the
end of literal string blocked the quote.
>>> rb'abc\\\'
SyntaxE