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

Updates to core.py for newer python versions #3358

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Spunky17
Copy link

For your consideration.

I forked the docker-headphones to update it as it was deprecated on linuxserver.io. In doing so I also updated it to alpine 3.21 which is considered the standard for docker images these days. In doing so I found that the core.py application produced the errors below. I believe it's a simple fix to add an extra escape character (), while not as clean as some others have suggested it does not cause issues further down the line.

2025-02-13 13:33:03.308390+00:00/app/headphones/lib/gntp/core.py:22: SyntaxWarning: invalid escape sequence '\d'
2025-02-13 13:33:03.308497+00:00'GNTP/(?P<version>\d+\.\d+) (?P<messagetype>REGISTER|NOTIFY|SUBSCRIBE|\-OK|\-ERROR)' +
2025-02-13 13:33:03.308524+00:00/app/headphones/lib/gntp/core.py:29: SyntaxWarning: invalid escape sequence '\d'
2025-02-13 13:33:03.308545+00:00'GNTP/(?P<version>\d+\.\d+) (?P<messagetype>REGISTER|NOTIFY|SUBSCRIBE|\-OK|\-ERROR)',
2025-02-13 13:33:03.308574+00:00/app/headphones/lib/gntp/core.py:33: SyntaxWarning: invalid escape sequence '\w'
2025-02-13 13:33:03.308594+00:00GNTP_HEADER = re.compile('([\w-]+):(.+)')

After making these updates the errors are no longer present when the application starts up.

updating to reflect python > v3.12
added additional escape characters "\" so that it will work with newer versions of python (>3.12)
changing how to correct python issues related to alpine 3.21 by using raw string instead of additional escape characters.
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

Successfully merging this pull request may close these issues.

1 participant