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 '\$' #63

Open
ilf opened this issue Oct 14, 2024 · 0 comments
Open

SyntaxWarning: invalid escape sequence '\$' #63

ilf opened this issue Oct 14, 2024 · 0 comments

Comments

@ilf
Copy link

ilf commented Oct 14, 2024

Python 3.12 produces this error:

Error output from fritzbox_traffic.py:
    /etc/munin/plugins/fritzbox_traffic.py:57: SyntaxWarning: invalid escape sequence '\$'
      print("graph_vlabel bits in (-) / out (+) per \${graph_period}")

That's this line:

print("graph_vlabel bits in (-) / out (+) per \${graph_period}")

https://github.com/Tafkas/fritzbox-munin/blob/master/fritzbox_traffic.py#L57

Python changed this:

Changed in version 3.11: Octal escapes with value larger than 0o377 produce a DeprecationWarning.

Changed in version 3.12: Octal escapes with value larger than 0o377 produce a SyntaxWarning. In a future Python version they will be eventually a SyntaxError.

https://docs.python.org/3/reference/lexical_analysis.html#escape-sequences

Seems like \$ should be changed.
Probably to $ or \\$.or something like that.
I'm not a Python expert, so I can't write a PR.

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

1 participant