Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #340: Always use raw strings for token regex #341

Merged
merged 1 commit into from
Oct 6, 2024

Conversation

glx22
Copy link
Contributor

@glx22 glx22 commented Oct 5, 2024

Whitespace handling in parser doesn't use raw string for the token rule, but it should have.
It somehow works when not using raw string with python <3.13, but fails with python 3.13.
Use raw strings for all token regular expressions.

@LordAro
Copy link
Member

LordAro commented Oct 5, 2024

I can't find anything either, though they've definitely been making changes in that area - this is in 3.12:

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.)

Maybe we should report a bug... ;)

@glx22 glx22 merged commit 166ea00 into OpenTTD:master Oct 6, 2024
21 checks passed
@glx22 glx22 deleted the fix_340 branch October 6, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants