Control: tags -1 + patch Hi Rene,
attached is a simple patch to fix this. Cheers Jochen * Rene Engelhard <r...@debian.org> [2023-02-19 09:12]:
clone 1031578 -1retitle -1 ru/hu fail to build with python 3.11: re.error: global flags not at the start of the expression at position 28block -1 by 1031578 tag -1 - unreproducible tag -1 + help thanks Hi, Am 19.02.23 um 08:49 schrieb Rene Engelhard:The real issue though seems to be a fallout of the python3 transition and that it breaks with python 3.11:for cfg in `find src -name "*.cfg"`; do \ python3 make.py $cfg; \ done/home/rene/lightproof-1.6/make.py:39: DeprecationWarning: The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in Python 3.12. Use ConfigParser directly instead.fArgs = cp.SafeConfigParser() /home/rene/lightproof-1.6/pythonpath/lightproof_compile___implname__.py:170: FutureWarning: Possible nested set at position 5 compr = re.compile(sc) Traceback (most recent call last):File "/home/rene/lightproof-1.6/pythonpath/lightproof_compile___implname__.py", line 170, in mysplitcompr = re.compile(sc) ^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/__init__.py", line 227, in compile return _compile(pattern, flags) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/__init__.py", line 294, in _compile p = _compiler.compile(pattern, flags) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/_compiler.py", line 743, in compile p = _parser.parse(p, flags) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/_parser.py", line 980, in parse p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/_parser.py", line 455, in _parse_sub itemsappend(_parse(source, state, verbose, nested + 1, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/_parser.py", line 841, in _parse raise source.error('global flags not at the start ' re.error: global flags not at the start of the expression at position 28 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/rene/lightproof-1.6/make.py", line 43, in <module> dist(i[:-4], fArgs._sections['args']) File "/home/rene/lightproof-1.6/make.py", line 15, in distcode = pythonpath.lightproof_compile___implname__.c(f.read(), a['lang'])^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/home/rene/lightproof-1.6/pythonpath/lightproof_compile___implname__.py", line 270, in citem = mysplit(lines[i].strip(), i + 1, oldlinenums[lines[i]], debug) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/home/rene/lightproof-1.6/pythonpath/lightproof_compile___implname__.py", line 174, in mysplitraise Exception(str(e), oldline)Exception: ('global flags not at the start of the expression at position 28', 126)missing config file or options: src/hu_HU/hu_HU.cfg/home/rene/lightproof-1.6/make.py:39: DeprecationWarning: The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in Python 3.12. Use ConfigParser directly instead.fArgs = cp.SafeConfigParser()/usr/lib/python3.11/zipfile.py:1547: UserWarning: Duplicate name: 'META-INF/manifest.xml'return self._open_to_write(zinfo, force_zip64=force_zip64)/home/rene/lightproof-1.6/make.py:39: DeprecationWarning: The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in Python 3.12. Use ConfigParser directly instead.fArgs = cp.SafeConfigParser() Traceback (most recent call last):File "/home/rene/lightproof-1.6/pythonpath/lightproof_compile___implname__.py", line 170, in mysplitcompr = re.compile(sc) ^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/__init__.py", line 227, in compile return _compile(pattern, flags) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/__init__.py", line 294, in _compile p = _compiler.compile(pattern, flags) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/_compiler.py", line 743, in compile p = _parser.parse(p, flags) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/_parser.py", line 980, in parse p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/_parser.py", line 455, in _parse_sub itemsappend(_parse(source, state, verbose, nested + 1, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/_parser.py", line 841, in _parse raise source.error('global flags not at the start ' re.error: global flags not at the start of the expression at position 28 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/rene/lightproof-1.6/make.py", line 43, in <module> dist(i[:-4], fArgs._sections['args']) File "/home/rene/lightproof-1.6/make.py", line 15, in distcode = pythonpath.lightproof_compile___implname__.c(f.read(), a['lang'])^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/home/rene/lightproof-1.6/pythonpath/lightproof_compile___implname__.py", line 270, in citem = mysplit(lines[i].strip(), i + 1, oldlinenums[lines[i]], debug) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/home/rene/lightproof-1.6/pythonpath/lightproof_compile___implname__.py", line 174, in mysplitraise Exception(str(e), oldline)Exception: ('global flags not at the start of the expression at position 28', 75)missing config file or options: src/ru_RU/ru_RU.cfg/home/rene/lightproof-1.6/make.py:39: DeprecationWarning: The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in Python 3.12. Use ConfigParser directly instead.fArgs = cp.SafeConfigParser()Making a new bug out of this since the actual original bug is not reproducible.Regards, Rene
From: Jochen Sprickerhof <jspri...@debian.org> Date: Sun, 19 Feb 2023 11:06:50 +0100 X-Dgit-Generated: 1.6-2 f7281d3d6950e5e9edf187fee6e3d8a89187c7d2 Subject: Move ignore case flag to the start of the regex Fixes: re.error: global flags not at the start of the expression at position 28 --- diff --git a/pythonpath/lightproof_compile___implname__.py b/pythonpath/lightproof_compile___implname__.py index c56c928..d13b1bf 100644 --- a/pythonpath/lightproof_compile___implname__.py +++ b/pythonpath/lightproof_compile___implname__.py @@ -103,11 +103,17 @@ def mysplit(s, line, oldline, debug): for i in repl: s1 = re.sub("[{]" + i + "}", repl[i], s1) # modes + ignore_case = False + if s1.startswith("(?i)"): + ignore_case = True + s1 = s1[4:] if mode == "[Word]" or mode == "[word]": if s1[0] == '^': s1 = r"((?<=[!?.] )|^)" + s1[1:] + r"(?![-\w\u2013\u00AD])" else: s1 = r"(?<![-\w\u2013.,\u00AD])" + s1 + r"(?![-\w\u2013\u00AD])" + if ignore_case: + s1 = "(?i)" + s1 # modes with casing ([Word] or [Char]) if mode == "[Word]" or mode == "[Char]": s1 = "(?i)" + s1
signature.asc
Description: PGP signature