From: Scott Kostyshak Date: Sat, 8 Jun 2024 15:54:44 +0000 (-0400) Subject: Fix Python warning of invalid escape in lyx_pot.py X-Git-Tag: 2.4.1~48^2 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9c16e25a84c3c1d813c0e4c2e5fa83e4965836ac;p=lyx.git Fix Python warning of invalid escape in lyx_pot.py Newer Python versions (e.g., Python 3.12.3) gave the following warning: po/lyx_pot.py:607: SyntaxWarning: invalid escape sequence '\w' An alternative fix would be to double the backslash, but that might be less readable than this fix. (cherry picked from commit 325f1429f83d7ce1d35404c3f99a31d19c0dbe45) --- diff --git a/po/lyx_pot.py b/po/lyx_pot.py index 665fdcddcf..76111bb71e 100755 --- a/po/lyx_pot.py +++ b/po/lyx_pot.py @@ -604,7 +604,7 @@ def encodings_l10n(input_files, output, base): output = io.open(output, 'w', encoding='utf_8', newline='\n') # assuming only one encodings file # Encoding utf8 utf8 "Unicode (utf8)" UTF-8 variable inputenc - reg = re.compile('Encoding [\w-]+\s+[\w-]+\s+"([\w \-\(\)\[\]\/^"]*)"\s+["\w-]+\s+(fixed|variable|variableunsafe)\s+\w+.*') + reg = re.compile(r'Encoding [\w-]+\s+[\w-]+\s+"([\w \-\(\)\[\]\/^"]*)"\s+["\w-]+\s+(fixed|variable|variableunsafe)\s+\w+.*') input = io.open(input_files[0], encoding='utf_8') for lineno, line in enumerate(input.readlines()): if not line.startswith('Encoding'):