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

Python 3.12 changes in regex special characters #73

Open
giachello opened this issue Apr 8, 2024 · 3 comments
Open

Python 3.12 changes in regex special characters #73

giachello opened this issue Apr 8, 2024 · 3 comments

Comments

@giachello
Copy link

Getting the following error messages

2024-04-08 08:58:20.108 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/alarmdecoder/decoder.py:605: SyntaxWarning: invalid escape sequence '\.'
  matches = re.match('^!Sending(\.{1,5})done.*', data)

2024-04-08 08:58:20.143 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/alarmdecoder/messages/panel_message.py:73: SyntaxWarning: invalid escape sequence '\['
  _regex = re.compile('^(!KPM:){0,1}(\[[a-fA-F0-9\-]+\]),([a-fA-F0-9]+),(\[[a-fA-F0-9]+\]),(".+")$')

2024-04-08 08:58:20.198 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/alarmdecoder/zonetracking.py:186: SyntaxWarning: invalid escape sequence '\d'
  zone_regex = re.compile('^CHECK (\d+).*$')

This is caused by a change in Python 3.12 (see https://docs.python.org/dev/whatsnew/3.12.html#other-language-changes)

Should be a pretty easy fix to add and r in front of strings containing escape characters.

@pleasantone
Copy link

Agreed. I wonder if we're going to have to fork this given the lack of response?

@giachello
Copy link
Author

I emailed the author on linkedin and he said he'd approve a pull request fixing it. I would do that instead of forking.

@pleasantone
Copy link

He approved but never merged a previous pull request. If you're in contact with him, could you ask him to review the pull requests and merge those he agrees with? Otherwise we need to talk about getting new maintainers or forking.

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

No branches or pull requests

2 participants