chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.09k stars 450 forks source link

Python 3.12 compatibility #3677

Closed jaragunde closed 2 months ago

jaragunde commented 2 months ago

Describe the bug The latest version of Python, 3.12, introduced a few breakages in Chromium scripts. This is the corresponding ticket in Chromium: https://issues.chromium.org/issues/40283283

There are a few scripts in CEF that are affected by this situation. Fortunately, these aren't breaking changes, they are still reported as warnings. It would be good to address them, anyway, to prevent problems in the future.

In particular, there are a number of SyntaxWarning messages now, caused by the use of unescaped backslashes in strings. These are abundant in regular expressions; the recommendation from Python docs is to use raw strings "for all but the simplest expressions".

To Reproduce Build CEF on a system with Python 3.12 running by default. A number of warning messages will appear:

.../cef/tools/cef_parser.py:358: SyntaxWarning: invalid escape sequence '\*'
.../cef/tools/cef_parser.py:362: SyntaxWarning: invalid escape sequence '\/'
...
.../cef/tools/cef_api_hash.py:140: SyntaxWarning: invalid escape sequence '\s'
.../cef/tools/cef_api_hash.py:148: SyntaxWarning: invalid escape sequence '\s'
.../cef/tools/cef_api_hash.py:156: SyntaxWarning: invalid escape sequence '\s'
...
.../cef/tools/make_pack_header.py:37: SyntaxWarning: invalid escape sequence '\s'

Expected behavior No warnings reported during the build process.

Versions:

magreenblatt commented 2 months ago

Thanks for the report and the related PR fix: https://bitbucket.org/chromiumembedded/cef/pull-requests/741