The new (in 0.26.0) check for W1401 ("Anomalous backslash in string") has this definition in it, to enumerate the backslash escapes that are meaningful in Python string literals:
ESCAPE_CHARACTERS = 'abfnrtvox\n\r\t\\\'\"'
This is not quite right, though. I think the mistake comes from a confusing table in the Python reference at http://docs.python.org/2/reference/lexical_analysis.html#literals .
In the escape sequence "\ooo" shown in that table, all of the "o" letters stand for octal digits- there is no "\o" escape in Python. The W1401 check should complain about any "\o" instances in non-raw strings, like it does for \d, etc.
And by the same token, "\0" IS a proper (and common) escape sequence in Python, which W1401 erroneously complains about. (See Footnote 3 after that Python reference escape sequences table; it is supported and ok for there to be only one octal digit in the escape sequence.
|appeared in||<not specified>|
|closed by||#720a5ebaba7d string check: don't warn about octal escape sequence, warn about \o (not octal in python). Closes #111799|