bad-string-format-type / E1307ΒΆ

Message emitted:

Argument %r does not match format type %r


Used when a type required by format string is not suitable for actual argument type

Problematic code:

print("%d" % "1")  # [bad-string-format-type]

Correct code:

print("%d" % 1)

Additional details:

This check is currently only active for "old-style" string formatting as seen in the examples. See Issue #6085 for more information.

Related links:

Created by the string checker.