From 4c4099966ad39d8ffe21e97bc2d24700aa8c8ffd Mon Sep 17 00:00:00 2001 From: Oxan van Leeuwen Date: Mon, 5 Jul 2021 00:04:18 +0200 Subject: [PATCH] Fix invalid escape sequences in regex (#1814) --- esphome/components/logger/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/esphome/components/logger/__init__.py b/esphome/components/logger/__init__.py index 2b571b817b..8d79c96f63 100644 --- a/esphome/components/logger/__init__.py +++ b/esphome/components/logger/__init__.py @@ -205,8 +205,7 @@ def maybe_simple_message(schema): def validate_printf(value): # https://stackoverflow.com/questions/30011379/how-can-i-parse-a-c-format-string-in-python - # pylint: disable=anomalous-backslash-in-string - cfmt = """\ + cfmt = r""" ( # start of capture group 1 % # literal "%" (?:[-+0 #]{0,5}) # optional flags