xpidl.py has errors with Python 3.11
Categories
(Core :: XPCOM, defect)
Tracking
()
People
(Reporter: alaskanemily, Assigned: mccr8)
References
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-esr102+
|
Details |
Trying to compile with Python 3.11, we seem to run afoul of https://github.com/python/cpython/issues/91222
I had a quick look but I don't know enough about Python regexs to really diagnose this any better.
0:01.33 ERROR: /home/emily/dev/gecko-dev/xpcom/idl-parser/xpidl/xpidl.py:1641: Invalid regular expression for rule 't_multilinecomment'. global flags not at the start of the expression at position 26
0:01.33 ERROR: /home/emily/dev/gecko-dev/xpcom/idl-parser/xpidl/xpidl.py:1647: Invalid regular expression for rule 't_singlelinecomment'. global flags not at the start of the expression at position 24
0:01.33 ERROR: /home/emily/dev/gecko-dev/xpcom/idl-parser/xpidl/xpidl.py:1660: Invalid regular expression for rule 't_LCDATA'. global flags not at the start of the expression at position 13
Assignee | ||
Comment 1•2 years ago
|
||
Thanks for filing. The regexp for multi line comments is r"/\*(?s).*?\*/"
. It looks like the IPDL compiler also has a t_multilinecomment and it does r"/\*(\n|.)*?\*/"
. So. Basically, (\n|.)
instead of (?s).
if I'm reading this correctly?
Assignee | ||
Comment 2•2 years ago
|
||
I think we can also use the t_linecomment(t)
rule from IPDL for t_singlelinecomment
. At least, things build with both of those swapped...
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
Looks like the LCDATA one can also be fixed by changing .
to (\n|.)
.
Assignee | ||
Comment 4•2 years ago
|
||
Apparently the use of these is being turned into an error in Python 3.11.
Fortunately, our uses appears to be rather trivial.
For t_multilinecomment and t_LCDATA, I dropped the (?s) flag and just
replaced the one use of . with (\n|.). (?s) means DOTALL, which means
that dot includes any character, including a newline. Otherwise it means
dot includes any character except a newline.
I took the new t_singlelinecomment from IPDL's parser.py, so I assume
it is reasonable enough. t_multilinecomment is also now the same as
in IPDL.
Assignee | ||
Comment 5•2 years ago
|
||
At your convenience, could you confirm that everything works in 3.11 with this patch applied? No big hurry, because I removed flags so I don't see how it wouldn't work, but it would be nice to double check. Thanks.
Reporter | ||
Comment 7•2 years ago
|
||
Yes, this fixes it on my system! Thanks for the quick fix.
Updated•2 years ago
|
Comment 9•2 years ago
|
||
bugherder |
Comment 10•2 years ago
|
||
Comment on attachment 9302761 [details]
Bug 1799982 - Remove uses of inline flags from XPIDL regexps.
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: Build failure with python 3.11
- User impact if declined: See above
- Fix Landed on Version: 108
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Practically speaking, this is a no-op change.
Comment 11•2 years ago
|
||
Comment on attachment 9302761 [details]
Bug 1799982 - Remove uses of inline flags from XPIDL regexps.
Approved for 102.8esr.
Comment 12•2 years ago
|
||
bugherder uplift |
Description
•