From a3794f2701eb54393b44d13da11680ec5314b8b8 Mon Sep 17 00:00:00 2001 From: aksagrimada <1955605+aksagrimada@users.noreply.github.com> Date: Tue, 6 Aug 2019 07:16:00 +0100 Subject: [PATCH] Resolve invalid escape sequence When run not as a decorator dynamodb2 displays an invalid escape sequence error /moto/dynamodb2/responses.py:603: DeprecationWarning: invalid escape sequence \s '\s*([=\+-])\s*', '\\1', update_expression) --- moto/dynamodb2/responses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moto/dynamodb2/responses.py b/moto/dynamodb2/responses.py index d34b176a7..86ca9a362 100644 --- a/moto/dynamodb2/responses.py +++ b/moto/dynamodb2/responses.py @@ -600,7 +600,7 @@ class DynamoHandler(BaseResponse): # E.g. `a = b + c` -> `a=b+c` if update_expression: update_expression = re.sub( - '\s*([=\+-])\s*', '\\1', update_expression) + r'\s*([=\+-])\s*', '\\1', update_expression) try: item = self.dynamodb_backend.update_item(