From: Joseph Sutton Date: Sun, 10 Sep 2023 23:59:34 +0000 (+1200) Subject: python:tests: Fix invalid escape sequences X-Git-Tag: tevent-0.16.0~389 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26ff87dcfeaf5a2aff5f28c0aa5d99437c79a68c;p=thirdparty%2Fsamba.git python:tests: Fix invalid escape sequences Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/dns_forwarder_helpers/server.py b/python/samba/tests/dns_forwarder_helpers/server.py index f6feb0bb690..c4c82dc5121 100644 --- a/python/samba/tests/dns_forwarder_helpers/server.py +++ b/python/samba/tests/dns_forwarder_helpers/server.py @@ -77,7 +77,7 @@ class DnsHandler(SocketServer.BaseRequestHandler): debug("%s: %s wrote:" % (SERVER_ID, self.client_address[0])) global timeout - m = re.match(b'^timeout\s+([\d.]+)$', data.strip()) + m = re.match(br'^timeout\s+([\d.]+)$', data.strip()) if m: timeout = float(m.group(1)) debug("timing out at %s" % timeout) diff --git a/python/samba/tests/samba_tool/user_virtualCryptSHA.py b/python/samba/tests/samba_tool/user_virtualCryptSHA.py index 4efa9a62a39..7b8e0cea2c5 100644 --- a/python/samba/tests/samba_tool/user_virtualCryptSHA.py +++ b/python/samba/tests/samba_tool/user_virtualCryptSHA.py @@ -39,7 +39,7 @@ HASH_OPTION = "password hash userPassword schemes" def _get_attribute(out, name): - p = re.compile("^" + name + ":\s+(\S+)") + p = re.compile("^" + name + r":\s+(\S+)") for line in out.split("\n"): m = p.match(line) if m: diff --git a/python/samba/tests/samba_tool/user_virtualCryptSHA_base.py b/python/samba/tests/samba_tool/user_virtualCryptSHA_base.py index e32f8d7343c..d4897ec5a52 100644 --- a/python/samba/tests/samba_tool/user_virtualCryptSHA_base.py +++ b/python/samba/tests/samba_tool/user_virtualCryptSHA_base.py @@ -39,7 +39,7 @@ HASH_OPTION = "password hash userPassword schemes" def _get_attribute(out, name): - p = re.compile("^" + name + ":\s+(\S+)") + p = re.compile("^" + name + r":\s+(\S+)") for line in out.split("\n"): m = p.match(line) if m: