.. _anomalous-backslash-in-string:

anomalous-backslash-in-string / W1401
=====================================

**Message emitted:**

Anomalous backslash in string: '%s'. String constant might be missing an r prefix.

**Description:**

*Used when a backslash is in a literal string but not as an escape.*

**Problematic code:**

.. literalinclude:: /data/messages/a/anomalous-backslash-in-string/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/a/anomalous-backslash-in-string/good.py
   :language: python



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