From 3a3145bfcd7a1de1e7cda2d3f2ba61a90d34cf11 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 27 Feb 2017 09:28:02 -0500 Subject: [PATCH] [1.11.x] Refs #27843 -- Fixed 'invalid escape sequence' warning in truncate_name(). Backport of 82026d61a383d07cd840a0d30443ee66bd99798b from master --- 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 ce5e274649..ad87eb82e7 100644 --- a/django/db/backends/utils.py +++ b/django/db/backends/utils.py @@ -186,7 +186,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: