From fe74596a6ae856672759986387004e21ff7f9482 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Tue, 29 Sep 2020 06:20:59 -0700 Subject: [PATCH] Use a raw string for a regular expression Previously, the string had an unrecognized escape sequence ('\*'). With a non-raw string we could have doubled the backslash, but it's much cleaner to just use a raw string instead, (so that backslashes are used for regular-expression escaping, and not also for string escaping). --- turbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbot.py b/turbot.py index e125e0d..7371dc2 100755 --- a/turbot.py +++ b/turbot.py @@ -64,7 +64,7 @@ def rot(): if not signature_verifier.is_valid_request(data, headers): return make_response("invalid request", 403) - match = re.match('^([0-9]+|\*) (.*)$', query) + match = re.match(r'^([0-9]+|\*) (.*)$', query) if (match): try: count = int(match.group(1)) -- 2.43.0