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 on Python 3.12 #46

Open
fossdd opened this issue May 4, 2024 · 0 comments · May be fixed by #55
Open

SyntaxWarning: invalid escape sequence on Python 3.12 #46

fossdd opened this issue May 4, 2024 · 0 comments · May be fixed by #55
Labels
bug Something isn't working

Comments

@fossdd
Copy link

fossdd commented May 4, 2024

Starting passes with Python 3.12 you'll get the following warnings.

/usr/share/passes/passes/digital_pass.py:159: SyntaxWarning: invalid escape sequence '\('
  result = re.search('rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)',
/usr/share/passes/passes/digital_pass.py:170: SyntaxWarning: invalid escape sequence '\#'
  result = re.search('\#(\S{2})(\S{2})(\S{2})(\S{2})',
/usr/share/passes/passes/digital_pass.py:305: SyntaxWarning: invalid escape sequence '\:'
  matches = re.finditer('(T|t)([0-9]{2}\:?)+(\+|\-|Z)?', string)
/usr/share/passes/passes/digital_pass_factory.py:110: SyntaxWarning: invalid escape sequence '\.'
  image_type = re.split('\.|@', file_name)[0]
/usr/share/passes/passes/pass_field_row.py:54: SyntaxWarning: invalid escape sequence '\S'
  value = re.sub('(?:(https?://)|(www))(\S+)',
/usr/share/passes/passes/pass_field_row.py:59: SyntaxWarning: invalid escape sequence '\+'
  value = re.sub('(\+\d+[\(\)\-\d\s\.]+\d)',
/usr/share/passes/passes/pass_field_row.py:64: SyntaxWarning: invalid escape sequence '\S'
  value = re.sub('(\S+\@[\w\-]+\.\w+)',

Would be nice to review these warnings and try to fix them.

@pablo-s pablo-s added the bug Something isn't working label May 6, 2024
fossdd added a commit to fossdd/passes that referenced this issue Oct 16, 2024
Addresses SyntaxWarnings introduced with Python 3.12+:

```
SyntaxWarning: invalid escape sequence '\:'
```

Closes pablo-s#46
@fossdd fossdd linked a pull request Oct 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants