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

fix syntax warnings #886

Merged
merged 1 commit into from
Feb 18, 2024
Merged

Conversation

mattrose
Copy link
Member

Got the following Warnings when running under python 3.12.1

home/mattrose/Code/terminator/terminatorlib/terminal.py:324: SyntaxWarning: invalid escape sequence '['
hostchars = "-A-Za-z0-9:[]"
/home/mattrose/Code/terminator/terminatorlib/terminal.py:348: SyntaxWarning: invalid escape sequence '.'
"(www|ftp)[" + hostchars + "].[" + hostchars +
/home/mattrose/Code/terminator/terminatorlib/terminal.py:354: SyntaxWarning: invalid escape sequence '.'
"[a-zA-Z0-9-]
.[a-zA-Z0-9][a-zA-Z0-9-]+" +
/home/mattrose/Code/terminator/terminatorlib/terminal.py:359: SyntaxWarning: invalid escape sequence '^'
"""news:[-A-Z^_a-z{|}~!"#$%&'()*+,./0-9;:=?`]+@""" +

To fix this, I changed the strings to raw strings to pass to the regex

Got the following Warnings when running under python 3.12.1

home/mattrose/Code/terminator/terminatorlib/terminal.py:324: SyntaxWarning: invalid escape sequence '\['
  hostchars = "-A-Za-z0-9:\[\]"
/home/mattrose/Code/terminator/terminatorlib/terminal.py:348: SyntaxWarning: invalid escape sequence '\.'
  "(www|ftp)[" + hostchars + "]*\.[" + hostchars +
/home/mattrose/Code/terminator/terminatorlib/terminal.py:354: SyntaxWarning: invalid escape sequence '\.'
  "[a-zA-Z0-9-]*\.[a-zA-Z0-9][a-zA-Z0-9-]+" +
/home/mattrose/Code/terminator/terminatorlib/terminal.py:359: SyntaxWarning: invalid escape sequence '\^'
  """news:[-A-Z\^_a-z{|}~!"#$%&'()*+,./0-9;:=?`]+@""" +

To fix this, I changed the strings to raw strings to pass to the regex
@mattrose mattrose merged commit 51e3bd2 into gnome-terminator:master Feb 18, 2024
2 checks passed
@mattrose mattrose deleted the fix-syntaxwarning branch February 18, 2024 15:31
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