.. _bad-format-character:

bad-format-character / E1300
============================

**Message emitted:**

Unsupported format character %r (%#02x) at index %d

**Description:**

*Used when an unsupported format character is used in a format string.*

**Problematic code:**

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

**Correct code:**

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

**Additional details:**

This check is currently only active for "old-style" string formatting as seen in the examples.
See `Issue #6085 <https://github.com/PyCQA/pylint/issues/6085>`_ for more information.

**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.