thunderbird/python3.11-regex-inline-flags.patch
Eike Rathke 3ec1ca4ba3 Fix f37 FTBFS Python 3.11 API incompatibilities
Python 3.11 "ValueError: invalid mode: 'rU'"
'U' is deprecated since Python 3 and default, error with Python 3.11
Remove 'U' from '"rU"' to '"r"'.

Python 3.11 "Invalid regular expression for rule '...'.
global flags not at the start of the expression at position ...
Change global inline flags (?s)... to local inline flags (?s:...)

See
https://docs.python.org/3.11/whatsnew/3.11.html#changes-in-the-python-api

* open(), io.open(), codecs.open() and fileinput.FileInput no
  longer accept 'U' (“universal newline”) in the file mode. This
  flag was deprecated since Python 3.3. In Python 3, the
  “universal newline” is used by default when a file is open in
  text mode.

* Global inline flags (e.g. (?i)) can now only be used at the
  start of the regular expressions. Using them not at the start of
  expression was deprecated since Python 3.6.
2022-07-12 15:17:59 +02:00

28 lines
988 B
Diff

--- thunderbird-91.11.0/xpcom/idl-parser/xpidl/xpidl.py.python-inline-flags 2022-06-28 04:39:56.000000000 +0200
+++ thunderbird-91.11.0/xpcom/idl-parser/xpidl/xpidl.py 2022-07-11 21:55:05.287553042 +0200
@@ -1563,13 +1563,13 @@ class IDLParser(object):
t_ignore = " \t"
def t_multilinecomment(self, t):
- r"/\*(?s).*?\*/"
+ r"/\*(?s:.*?)\*/"
t.lexer.lineno += t.value.count("\n")
if t.value.startswith("/**"):
self._doccomments.append(t.value)
def t_singlelinecomment(self, t):
- r"(?m)//.*?$"
+ r"(?m://.*?$)"
def t_IID(self, t):
return t
@@ -1582,7 +1582,7 @@ class IDLParser(object):
return t
def t_LCDATA(self, t):
- r"(?s)%\{[ ]*C\+\+[ ]*\n(?P<cdata>.*?\n?)%\}[ ]*(C\+\+)?"
+ r"(?s:%\{[ ]*C\+\+[ ]*\n(?P<cdata>.*?\n?)%\}[ ]*(C\+\+)?)"
t.type = "CDATA"
t.value = t.lexer.lexmatch.group("cdata")
t.lexer.lineno += t.value.count("\n")