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 '\s' when compiling RCV_REGEX #60

Open
Xelynega opened this issue Feb 15, 2024 · 1 comment
Open

Comments

@Xelynega
Copy link

Xelynega commented Feb 15, 2024

The following error is given when running the nrf802154_sniffer.py script in Python 3.12.2:

nrf802154_sniffer.py:81: SyntaxWarning: invalid escape sequence '\s'
  RCV_REGEX = 'received:\s+([0-9a-fA-F]+)\s+power:\s+(-?\d+)\s+lqi:\s+(\d+)\s+time:\s+(-?\d+)'

I was able to fix it by escaping all the backslashes, but not sure what the correct fix would be here to maintain version compatibility with the version it was working in previously.

@stig-bjorlykke
Copy link
Collaborator

What about changing this line to
RCV_REGEX = r'received:\s+([0-9a-fA-F]+)\s+power:\s+(-?\d+)\s+lqi:\s+(\d+)\s+time:\s+(-?\d+)'

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