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/core/checks/urls.py | 2 +- django/core/validators.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'django/core') diff --git a/django/core/checks/urls.py b/django/core/checks/urls.py index 8356fc2f00..e744cc0ca4 100644 --- a/django/core/checks/urls.py +++ b/django/core/checks/urls.py @@ -78,7 +78,7 @@ def check_include_trailing_dollar(pattern): Check that include is not used with a regex ending with a dollar. """ regex_pattern = pattern.regex.pattern - if regex_pattern.endswith('$') and not regex_pattern.endswith('\$'): + if regex_pattern.endswith('$') and not regex_pattern.endswith(r'\$'): warning = Warning( "Your URL pattern {} uses include with a regex ending with a '$'. " "Remove the dollar from the regex to avoid problems including " diff --git a/django/core/validators.py b/django/core/validators.py index 805dd8860f..5a7fd1a49b 100644 --- a/django/core/validators.py +++ b/django/core/validators.py @@ -88,12 +88,12 @@ class URLValidator(RegexValidator): # Max length for domain name labels is 63 characters per RFC 1034 sec. 3.1 domain_re = r'(?:\.(?!-)[a-z' + ul + r'0-9-]{1,63}(?