Text of codeql.github.com › codeql-query-help › python › py-percent-format-unsupported-char… as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout.

Open the live page

Unsupported format character — CodeQL query help documentation

CodeQL query help documentation » CodeQL query help for Python » Unsupported format character ¶ ID: py/percent-format/unsupported-character Kind: problem Security severity: Severity: error Precision: high Tags: - quality - reliability - correctness Query suites: - python-code-quality.qls - python-security-and-quality.qls Click to see the query in the CodeQL repository A printf-style format string (i.e. a string that is used as the left hand side of the % operator, such as fmt % arguments ) must consist of valid conversion specifiers, such as %s , %d , etc.

Otherwise, a ValueError will be raised. Recommendation ¶ Ensure a valid conversion specifier is used. Example ¶ In the following example, format_as_tuple_incorrect , %t is not a valid conversion specifier. def format_as_tuple_incorrect ( args ): return "%t" % args def format_as_tuple_correct ( args ): return " %r " % ( args ,) References ¶ Python Library Reference: printf-style String Formatting. © GitHub, Inc. Terms Privacy