From caa0230e5d76f30f6ed060877e15a37e3963e91c Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 13 Dec 2023 22:30:53 +0800 Subject: [PATCH] test/cql-pytest: use raw string when appropriate we use "\w" to represent a character class in Python. see https://docs.python.org/3/library/re.html. but "\" should be escaped as well, CPython accepts "\w" after trying to find an escaped character of "\." but failed, and leave "\." as it is. but it complains. in this change, we use raw string to avoid escaping "\" in the regular expression. Signed-off-by: Kefu Chai Closes scylladb/scylladb#16405 --- test/cql-pytest/nodetool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cql-pytest/nodetool.py b/test/cql-pytest/nodetool.py index 78a475f71a..3abd177564 100644 --- a/test/cql-pytest/nodetool.py +++ b/test/cql-pytest/nodetool.py @@ -122,7 +122,7 @@ def disablebinary(cql): run_nodetool(cql, "disablebinary") def parse_keyspace_table(name, separator_chars = '.'): - pat = f"(?P\w+)(?:[{separator_chars}](?P\w+))?" + pat = rf"(?P\w+)(?:[{separator_chars}](?P
\w+))?" m = re.match(pat, name) return m.group('keyspace'), m.group('table')