python-panasonic-comfort-cloud icon indicating copy to clipboard operation
python-panasonic-comfort-cloud copied to clipboard

Use raw string for regex to avoid SyntaxWarning

Open heldchen opened this issue 1 year ago • 2 comments

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 https://github.com/sockless-coding/panasonic_cc/issues/206

heldchen avatar Jun 23 '24 10:06 heldchen

Added to my PR #94 Thanks

danielcherubini avatar Jun 24 '24 09:06 danielcherubini

Hi, I'll be happy to merge this, but can you rebase your PR to match the newest changes. These regex'es is moved around after the auth refactor

https://github.com/lostfields/python-panasonic-comfort-cloud/blob/8ca861f92a968a71453d02039ba585580612a83f/pcomfortcloud/apiclient.py#L255-L265

lostfields avatar Nov 09 '24 11:11 lostfields