[PATCH] Python 3.6 invalid escape sequence deprecation fixes
https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior
---
distro_tracker/core/utils/email_messages.py | 2 +-
distro_tracker/mail/control/commands/keywords.py | 4 ++--
distro_tracker/project/urls.py | 2 +-
setup.py | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/distro_tracker/core/utils/email_messages.py b/distro_tracker/core/utils/email_messages.py
index d7d370e..db73758 100644
--- a/distro_tracker/core/utils/email_messages.py
+++ b/distro_tracker/core/utils/email_messages.py
@@ -65,7 +65,7 @@ def names_and_addresses_from_string(content):
"""
all_parts = [
name_and_address_from_string(part)
- for part in re.split('(?<=>)\s*,\s*', content)
+ for part in re.split(r'(?<=>)\s*,\s*', content)
]
return [
part
diff --git a/distro_tracker/mail/control/commands/keywords.py b/distro_tracker/mail/control/commands/keywords.py
index 12a1a13..10ffd4f 100644
--- a/distro_tracker/mail/control/commands/keywords.py
+++ b/distro_tracker/mail/control/commands/keywords.py
@@ -277,7 +277,7 @@ class SetDefaultKeywordsCommand(Command, KeywordCommandMixin):
self.keywords)
def handle(self):
- keywords = re.split('[,\s]+', self.keywords)
+ keywords = re.split(r'[,\s]+', self.keywords)
user_email, _ = UserEmail.objects.get_or_create(email=self.email)
email_settings, _ = \
EmailSettings.objects.get_or_create(user_email=user_email)
@@ -333,7 +333,7 @@ class SetPackageKeywordsCommand(Command, KeywordCommandMixin):
Actual implementation of the keyword command version which handles
subscription specific keywords.
"""
- keywords = re.split('[,\s]+', self.keywords)
+ keywords = re.split(r'[,\s]+', self.keywords)
subscription = self.get_subscription(self.email, self.package)
if not subscription:
return
diff --git a/distro_tracker/project/urls.py b/distro_tracker/project/urls.py
index 5a5b091..2b69f4c 100644
--- a/distro_tracker/project/urls.py
+++ b/distro_tracker/project/urls.py
@@ -78,7 +78,7 @@ urlpatterns = [
# Permanent redirect for the old RSS URL
url(r'^(?P<package_hash>(lib)?.)/(?P<package_name>(\1).+)'
- '/news\.rss20\.xml$',
+ r'/news\.rss20\.xml$',
legacy_rss_redirect),
url(r'^search$', PackageSearchView.as_view(),
diff --git a/setup.py b/setup.py
index 9277b53..8282f04 100755
--- a/setup.py
+++ b/setup.py
@@ -34,7 +34,7 @@ def find_package_data(basedir):
with open('debian/changelog') as f:
- res = re.search('\((\d.*)\)', f.readline())
+ res = re.search(r'\((\d.*)\)', f.readline())
version = res.group(1)
setup(name='DistroTracker',
--
2.14.1
Reply to: