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

SyntaxWarning: invalid escape sequence '\W' return re.sub("\W+", "", string) #139040

Open
Doorshifter opened this issue Feb 22, 2025 · 1 comment

Comments

@Doorshifter
Copy link

The problem

After every HA reboot I get this warning:

Logger: py.warnings Source: components/solaredge/coordinator.py:10 First occurred: 08:08:15 (1 occurrences) Last logged: 08:08:15 /usr/local/lib/python3.13/site-packages/stringcase.py:247: SyntaxWarning: invalid escape sequence '\W' return re.sub("\W+", "", string)

This warning was introduced in Python 3.6 as a DeprecationWarning and changed to a SyntaxWarning in Python 3.12, from what I can find.

The warning doesn't affect functionality currently, but I think it indicates that this code may break in future Python versions.

What version of Home Assistant Core has the issue?

core-2025.2.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Solaredge

Link to integration documentation on our website

https://www.home-assistant.io/integrations/solaredge

Diagnostics information

Example YAML snippet

Anything in the logs that might be useful for us?

Additional information

To me this could be a solution, but I am not completely sure:
replace 'return re.sub("\W+", "", string)' by 'return re.sub(r"\W+", "", string)'?

@home-assistant
Copy link

Hey there @frenck, @bdraco, mind taking a look at this issue as it has been labeled with an integration (solaredge) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of solaredge can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign solaredge Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


solaredge documentation
solaredge source
(message by IssueLinks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants