From 82026d61a383d07cd840a0d30443ee66bd99798b Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 27 Feb 2017 09:28:02 -0500 Subject: [PATCH] Refs #27843 -- Fixed 'invalid escape sequence' warning in truncate_name(). --- django/db/backends/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/backends/utils.py b/django/db/backends/utils.py index 81eb8693ac..b5ad5f17a2 100644 --- a/django/db/backends/utils.py +++ b/django/db/backends/utils.py @@ -183,7 +183,7 @@ def truncate_name(name, length=None, hash_len=4): If a quote stripped name contains a username, e.g. USERNAME"."TABLE, truncate the table portion only. """ - match = re.match('([^"]+)"\."([^"]+)', name) + match = re.match(r'([^"]+)"\."([^"]+)', name) table_name = match.group(2) if match else name if length is None or len(table_name) <= length: