.. _missing-format-attribute:

missing-format-attribute / W1306
================================

**Message emitted:**

Missing format attribute %r in format specifier %r

**Description:**

*Used when a PEP 3101 format string uses an attribute specifier ({0.length}), but the argument passed for formatting doesn't have that attribute.*

**Problematic code:**

.. literalinclude:: /data/messages/m/missing-format-attribute/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/m/missing-format-attribute/good.py
   :language: python



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