Author: Daniel Baumann Description: Using raw string literals in regular expressions to avoid warnings with Python 3.12. Updating some more regular expressions to use raw strings where it seem to have been forgotten, in sync with the other regular expressions used throughout litecli. diff -Naurp litecli.orig/litecli/packages/parseutils.py litecli/litecli/packages/parseutils.py --- litecli.orig/litecli/packages/parseutils.py +++ litecli/litecli/packages/parseutils.py @@ -12,7 +12,7 @@ cleanup_regex = { # This matches everything except spaces, parens, colon, comma, and period "most_punctuations": re.compile(r"([^\.():,\s]+)$"), # This matches everything except a space. - "all_punctuations": re.compile("([^\s]+)$"), + "all_punctuations": re.compile(r"([^\s]+)$"), } diff -Naurp litecli.orig/litecli/packages/special/iocommands.py litecli/litecli/packages/special/iocommands.py --- litecli.orig/litecli/packages/special/iocommands.py +++ litecli/litecli/packages/special/iocommands.py @@ -121,7 +121,7 @@ def get_editor_query(sql): # The reason we can't simply do .strip('\e') is that it strips characters, # not a substring. So it'll strip "e" in the end of the sql also! # Ex: "select * from style\e" -> "select * from styl". - pattern = re.compile("(^\\\e|\\\e$)") + pattern = re.compile(r"(^\\\e|\\\e$)") while pattern.search(sql): sql = pattern.sub("", sql) @@ -245,7 +245,7 @@ def subst_favorite_query_args(query, arg + query, ] - match = re.search("\\?|\\$\d+", query) + match = re.search(r"\\?|\\$\d+", query) if match: return [ None, diff -Naurp litecli.orig/litecli/sqlcompleter.py litecli/litecli/sqlcompleter.py --- litecli.orig/litecli/sqlcompleter.py +++ litecli/litecli/sqlcompleter.py @@ -257,7 +257,7 @@ class SQLCompleter(Completer): self.reserved_words = set() for x in self.keywords: self.reserved_words.update(x.split()) - self.name_pattern = compile("^[_a-z][_a-z0-9\$]*$") + self.name_pattern = compile(r"^[_a-z][_a-z0-9\$]*$") self.special_commands = [] self.table_formats = supported_formats