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

Use raw string for regex to avoid SyntaxWarning #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

heldchen
Copy link

in python 3 strings are considered unicode. the \% escape used in the regex is therefore treated as an unicode escape instead of a regex character escape. as this is not a valid unicode escape, python 3.12+ throws an SyntaxWarning.

treating the regex string as a raw string fixes the issue.

fixes sockless-coding/panasonic_cc#206

in python 3 strings are considered unicode. the `\%` escape used in the regex is therefore treated as an unicode escape instead of a regex character escape. as this is not a valid unicode escape, python 3.12+ throws an SyntaxWarning.

treating the regex string as a raw string fixes the issue.

fixes sockless-coding/panasonic_cc#206
@danielcherubini
Copy link
Contributor

Added to my PR #94 Thanks

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.

SyntaxWarning: invalid escape sequence
2 participants