Technically, any odd number of backslashes, as described in the documentation.
>>> r\'\\\'
File \"\", line 1
r\'\\\'
^
Syn
Despite its role, even a raw string cannot end in a single backslash, because the backslash escapes the following quote character—you still must escape the surrounding quote character to embed it in the string. That is, r"...\" is not a valid string literal—a raw string cannot end in an odd number of backslashes.
If you need to end a raw string with a single backslash, you can use two and slice off the second.