Skip to content

Fix invalid escape sequence warning#416

Merged
tomaae merged 4 commits into
tomaae:masterfrom
mvdwetering:fix_invalid_escape_warning
Apr 30, 2025
Merged

Fix invalid escape sequence warning#416
tomaae merged 4 commits into
tomaae:masterfrom
mvdwetering:fix_invalid_escape_warning

Conversation

@mvdwetering
Copy link
Copy Markdown
Contributor

Proposed change

I noticed this warning in Home Assistant logs when running master.

2025-04-25 20:48:18.373 WARNING (ImportExecutor_0) [py.warnings] /config/custom_components/mikrotik_router/coordinator.py:1584: SyntaxWarning: invalid escape sequence '\.'
  version = re.sub("[^0-9\.]", "", full_version[0:split_end])

Using raw string for the regex fixes the warning.

Type of change

  • Bugfix
  • New feature
  • Code quality improvements to existing code or addition of tests
  • Documentation

Additional information

Checklist

  • The code change is tested and works locally.
  • The code has been formatted using Black.
  • Tests have been added to verify that the new code works.
  • Documentation added/updated if required.

@mvdwetering
Copy link
Copy Markdown
Contributor Author

mvdwetering commented Apr 25, 2025

The linting fails on unrelated code.
Unclear why it triggers now and not when that code originally got merged.

edit: Fixed the typehint also...

@mvdwetering
Copy link
Copy Markdown
Contributor Author

Hassfest check is failing because of missing translations and order of keys in manifest.json. Not going to fix those because really out of scope for this fix.

Security check is probably failing because the bandit configuration does not exist (anymore?)

Because of all these errors I get the impression I am using the wrong source branch, but as far as I can see it is correct. Not sure why all is failing for this tiny change.

@tomaae tomaae merged commit 955fa33 into tomaae:master Apr 30, 2025
5 of 7 checks passed
@mvdwetering mvdwetering deleted the fix_invalid_escape_warning branch April 30, 2025 18:37
@github-actions github-actions Bot locked and limited conversation to collaborators May 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants