Files
codeql/python/ql/src/Expressions/UnsupportedFormatCharacter.qhelp

30 lines
884 B
XML

<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>A printf-style format string (i.e. a string that is used as the left hand side of the <code>%</code> operator, such as <code>fmt % arguments</code>)
must consist of valid conversion specifiers, such as <code>%s</code>, <code>%d</code>, etc.
Otherwise, a <code>ValueError</code> will be raised.
</p>
</overview>
<recommendation>
<p>Ensure a valid conversion specifier is used.</p>
</recommendation>
<example>
<p>In the following example, <code>format_as_tuple_incorrect</code>, <code>%t</code> is not a valid conversion specifier.
</p>
<sample src="UnsupportedFormatCharacter.py" />
</example>
<references>
<li>Python Library Reference: <a href="https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting">printf-style String Formatting.</a> </li>
</references>
</qhelp>