From 8119b679eb85cdc0ae3d321e54d06dd0200a1e82 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 16 Sep 2016 12:15:00 -0400 Subject: Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6. http://bugs.python.org/issue27364 --- django/template/base.py | 2 +- django/template/defaultfilters.py | 2 +- django/template/defaulttags.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'django/template') diff --git a/django/template/base.py b/django/template/base.py index 778d82be55..13037c31aa 100644 --- a/django/template/base.py +++ b/django/template/base.py @@ -639,7 +639,7 @@ filter_raw_string = r""" )""" % { 'constant': constant_string, 'num': r'[-+\.]?\d[\d\.e]*', - 'var_chars': "\w\.", + 'var_chars': r'\w\.', 'filter_sep': re.escape(FILTER_SEPARATOR), 'arg_sep': re.escape(FILTER_ARGUMENT_SEPARATOR), } diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py index e3dc48e474..b258cf269b 100644 --- a/django/template/defaultfilters.py +++ b/django/template/defaultfilters.py @@ -259,7 +259,7 @@ def stringformat(value, arg): def title(value): """Converts a string into titlecase.""" t = re.sub("([a-z])'([A-Z])", lambda m: m.group(0).lower(), value.title()) - return re.sub("\d([A-Z])", lambda m: m.group(0).lower(), t) + return re.sub(r"\d([A-Z])", lambda m: m.group(0).lower(), t) @register.filter(is_safe=True) diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py index ece6f7501d..71fcbbaab3 100644 --- a/django/template/defaulttags.py +++ b/django/template/defaulttags.py @@ -1329,7 +1329,7 @@ def templatetag(parser, token): @register.tag def url(parser, token): - """ + r""" Return an absolute URL matching the given view with its parameters. This is a way to define links that aren't tied to a particular URL -- cgit v1.3