anomalous-unicode-escape-in-string / W1402ΒΆ

Message emitted:

Anomalous Unicode escape in byte string: '%s'. String constant might be missing an r or u prefix.


Used when an escape like u is encountered in a byte string where it has no effect.

Problematic code:

print(b"\u%b" % b"0394")  # [anomalous-unicode-escape-in-string]

Correct code:

print(b"\\u%b" % b"0394")

Created by the string checker.