.. _bad-format-string:

bad-format-string / W1302
=========================

**Message emitted:**

Invalid format string

**Description:**

*Used when a PEP 3101 format string is invalid.*

**Problematic code:**

.. literalinclude:: /data/messages/b/bad-format-string/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/b/bad-format-string/good.py
   :language: python


**Related links:**

- `Format String Syntax <https://docs.python.org/3/library/string.html#formatstrings>`_
- `PyFormat <https://pyformat.info/>`_

Created by the `string <https://github.com/PyCQA/pylint/blob/main/pylint/checkers/strings.py>`__ checker.