diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 07:47:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 07:47:20 +0000 |
commit | f3d1b3d0e4a7f87ec4c6a49ca21f6c4a40408b08 (patch) | |
tree | 329431ea10212eba4494ac8eac480de27ae5e13f | |
parent | Releasing debian version 1.10.1-1. (diff) | |
download | litecli-f3d1b3d0e4a7f87ec4c6a49ca21f6c4a40408b08.tar.xz litecli-f3d1b3d0e4a7f87ec4c6a49ca21f6c4a40408b08.zip |
Adding patches to fix warnings with Python 3.12 (Closes: #1068897).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r-- | debian/patches/debian/0001-python3.12-comments.patch | 33 | ||||
-rw-r--r-- | debian/patches/debian/0002-python3.12-re.patch | 51 | ||||
-rw-r--r-- | debian/patches/series | 2 |
3 files changed, 86 insertions, 0 deletions
diff --git a/debian/patches/debian/0001-python3.12-comments.patch b/debian/patches/debian/0001-python3.12-comments.patch new file mode 100644 index 0000000..cdee6be --- /dev/null +++ b/debian/patches/debian/0001-python3.12-comments.patch @@ -0,0 +1,33 @@ +Author: Daniel Baumann <daniel.baumann@progress-linux.org> +Description: Marking some comments as raw string literals to avoid warnings with Python 3.12. + In Python 3.12 when using string literals as comments, they need to by syntactically valid, + otherwise a SyntaxWarning instead of the previous DeprecationWarning is shown. + . + Instead of string literals for comments, actual comments (#) should be used. To keep the + diff in Debian small and be less invasive to upstream, raw string literals can be used as + a workaround as escape sequences are not parsed. + +diff -Naurp litecli.orig/litecli/main.py litecli/litecli/main.py +--- litecli.orig/litecli/main.py ++++ litecli/litecli/main.py +@@ -329,7 +329,7 @@ class LiteCli(object): + exit(1) + + def handle_editor_command(self, text): +- """Editor command is any query that is prefixed or suffixed by a '\e'. ++ r"""Editor command is any query that is prefixed or suffixed by a '\e'. + The reason for a while loop is because a user might edit a query + multiple times. For eg: + +diff -Naurp litecli.orig/litecli/packages/parseutils.py litecli/litecli/packages/parseutils.py +--- litecli.orig/litecli/packages/parseutils.py ++++ litecli/litecli/packages/parseutils.py +@@ -17,7 +17,7 @@ cleanup_regex = { + + + def last_word(text, include="alphanum_underscore"): +- """ ++ r""" + Find the last word in a sentence. + + >>> last_word('abc') diff --git a/debian/patches/debian/0002-python3.12-re.patch b/debian/patches/debian/0002-python3.12-re.patch new file mode 100644 index 0000000..6310f22 --- /dev/null +++ b/debian/patches/debian/0002-python3.12-re.patch @@ -0,0 +1,51 @@ +Author: Daniel Baumann <daniel.baumann@progress-linux.org> +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 diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..98a6a66 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,2 @@ +debian/0001-python3.12-comments.patch +debian/0002-python3.12-re.patch |