From e071df39ab444037f84f6d88cf8f98538c508ed1 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sun, 2 Nov 2025 09:41:14 +0100 Subject: [PATCH] log._clean_str_regex: Fix missing r-qualifier Fix missing raw string qualifier missing from regex with backslashes. Signed-off-by: Jan Lindemann --- tools/python/jwutils/log.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/python/jwutils/log.py b/tools/python/jwutils/log.py index 2c94dac..b324a5b 100644 --- a/tools/python/jwutils/log.py +++ b/tools/python/jwutils/log.py @@ -30,7 +30,7 @@ _special_chars = { _special_char_regex = re.compile("(%s)" % "|".join(map(re.escape, _special_chars.keys()))) _all_control_chars = ''.join(chr(c) for c in range(sys.maxunicode) if unicodedata.category(chr(c)) in {'Cc'}) -_clean_str_regex = re.compile('(\033\[[0-9]*m|[%s])' % re.escape(_all_control_chars)) +_clean_str_regex = re.compile(r'(\033\[[0-9]*m|[%s])' % re.escape(_all_control_chars)) EMERG = int(syslog.LOG_EMERG) ALERT = int(syslog.LOG_ALERT) @@ -72,7 +72,7 @@ _log_prefix = '' _clean_log_prefix = '' _file_name_len = 20 _module_name_len = 50 -_log_file_streams = [] +_log_file_streams: list[io.TextIOWrapper] = [] _short_prio_str = { EMERG : '',