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 warnings about invalid escape sequences #135

Merged
merged 2 commits into from
May 10, 2024

Conversation

chennin
Copy link
Contributor

@chennin chennin commented May 10, 2024

I received the following warnings on Python 3.10.12. (Python 3.12 changes them to SyntaxWarning). This PR changes multiple strings fed to re in to raw strings (and yes, f and r can be combined like that).

stellarisdashboard/config.py:459
  /home/.../stellaris-dashboard/stellarisdashboard/config.py:459: DeprecationWarning: invalid escape sequence '\s'
    match = re.match('^\s*path\s*=\s*"(.*)"\s*$', line)

stellarisdashboard/config.py:471
stellarisdashboard/config.py:471
  /home/.../stellaris-dashboard/stellarisdashboard/config.py:471: DeprecationWarning: invalid escape sequence '\s'
    match = re.match(f"^\ufeff\s*{language}\s*:\s*$", first_line)

test/parser_test.py::test_real_save
test/parser_test.py::test_real_save
  /home/.../stellaris-dashboard/stellarisdashboard/game_info.py:194: DeprecationWarning: invalid escape sequence '\$'
    render_template = re.sub(f"\${match}\$", resolved, render_template)

@MichaelMakesGames MichaelMakesGames merged commit 22f62f2 into eliasdoehne:master May 10, 2024
3 checks passed
@chennin chennin deleted the fix-invalid-escape branch May 11, 2024 11:21
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