Closed iandobbie closed 1 month ago
You are right. Apparently, this has been happening since python 3.6 but it was a DeprecationWarning
. Python 3.12 bumped it to SyntaxWarning
with the goal of bumping it to SyntaxError
later. See python 3.12 changes:
- A backslash-character pair that is not a valid escape sequence now generates a SyntaxWarning, instead of DeprecationWarning. For example, re.compile("\d+.\d+") now emits a SyntaxWarning ("\d" is an invalid escape sequence, use raw strings for regular expression: re.compile(r"\d+.\d+")). In a future Python version, SyntaxError will eventually be raised, instead of SyntaxWarning. (Contributed by Victor Stinner in gh-98401.)
Simple fix to just make the regexps raw strings. Pushed above and closing as fixed.
So we have a few regexps in the code that contain \ escape sequences that are now syntax errors. I think these just need to be replaced with raw strings.