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

[Bug]: config.py:is_blank_line regex throws a warning for invalid escape sequence in python 3.12 #36

Closed
1 task done
gtjoseph opened this issue Feb 15, 2024 · 0 comments · Fixed by #37
Closed
1 task done
Labels

Comments

@gtjoseph
Copy link
Member

Severity

Trivial

Versions

18,20,21,master

Components/Modules

lib/python/asterisk/config.py

Operating Environment

Python 3.12

Frequency of Occurrence

Constant

Issue Description

Python 3.12 now throws warnings about invalid escape sequences in regexes.
For instance, in re.match("\s*(?:;.*)?$"), the single backslash for the whitespace matcher needs to be doubled: re.match("\\s*(?:;.*)?$").

Relevant log output

/usr/src/asterisk/testsuite/lib/python/asterisk/config.py:27: SyntaxWarning: invalid escape sequence '\s'
  return re.match("\s*(?:;.*)?$", line) is not None

Asterisk Issue Guidelines

  • Yes, I have read the Asterisk Issue Guidelines
gtjoseph added a commit to gtjoseph/testsuite that referenced this issue Feb 15, 2024
Python 3.12 warns that regex sequences embedded in strings,
like `"\s*"`, need to be double-escaped: `"\\s*"`

Resolves: asterisk#36
asterisk-org-access-app bot pushed a commit that referenced this issue Feb 16, 2024
Python 3.12 warns that regex sequences embedded in strings,
like `"\s*"`, need to be double-escaped: `"\\s*"`

Resolves: #36
asterisk-org-access-app bot pushed a commit that referenced this issue Feb 16, 2024
Python 3.12 warns that regex sequences embedded in strings,
like `"\s*"`, need to be double-escaped: `"\\s*"`

Resolves: #36
asterisk-org-access-app bot pushed a commit that referenced this issue Feb 16, 2024
Python 3.12 warns that regex sequences embedded in strings,
like `"\s*"`, need to be double-escaped: `"\\s*"`

Resolves: #36
asterisk-org-access-app bot pushed a commit that referenced this issue Feb 16, 2024
Python 3.12 warns that regex sequences embedded in strings,
like `"\s*"`, need to be double-escaped: `"\\s*"`

Resolves: #36
asterisk-org-access-app bot pushed a commit that referenced this issue Feb 16, 2024
Python 3.12 warns that regex sequences embedded in strings,
like `"\s*"`, need to be double-escaped: `"\\s*"`

Resolves: #36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant