Skip to content

Comments

Fix SyntaxWarning: invalid escape sequence.#37

Merged
mkaranasou merged 3 commits intomkaranasou:mainfrom
lukeanderson93:main
Jan 13, 2025
Merged

Fix SyntaxWarning: invalid escape sequence.#37
mkaranasou merged 3 commits intomkaranasou:mainfrom
lukeanderson93:main

Conversation

@lukeanderson93
Copy link
Contributor

https://docs.python.org/3/whatsnew/3.12.html

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

Fixes: #35

https://docs.python.org/3/whatsnew/3.12.html

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.)
@lukeanderson93 lukeanderson93 changed the title Fix SyntaxWarning: incalid escape sequence. Fix SyntaxWarning: invalid escape sequence. Dec 10, 2024
@mkaranasou mkaranasou added the bug Something isn't working label Jan 8, 2025
@mkaranasou mkaranasou assigned mkaranasou and unassigned mkaranasou Jan 8, 2025
@mkaranasou mkaranasou self-requested a review January 8, 2025 13:01
Copy link
Owner

@mkaranasou mkaranasou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 lgtm

@mkaranasou mkaranasou merged commit 92b8d76 into mkaranasou:main Jan 13, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] SyntaxWarning due to invalid escape sequence

2 participants