Repository: Kinto/kinto

Issue:
Remove regex deprecation warnings
When running `make tests` on master (8efa5ad190) I see those warnings: (not much information about line)

@glasserc I remember you found some in #1758 
``` 
<unknown>:1
  <unknown>:1: DeprecationWarning: invalid escape sequence \]
  <unknown>:1: DeprecationWarning: invalid escape sequence \]
  <unknown>:1: DeprecationWarning: invalid escape sequence \.
  <unknown>:1: DeprecationWarning: invalid escape sequence \.
  <unknown>:1: DeprecationWarning: invalid escape sequence \.
  <unknown>:1: DeprecationWarning: invalid escape sequence \.
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \?
  <unknown>:1: DeprecationWarning: invalid escape sequence \?
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \?
  <unknown>:1: DeprecationWarning: invalid escape sequence \?
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \]
  <unknown>:1: DeprecationWarning: invalid escape sequence \]
  <unknown>:1: DeprecationWarning: invalid escape sequence \.
  <unknown>:1: DeprecationWarning: invalid escape sequence \.
  <unknown>:1: DeprecationWarning: invalid escape sequence \.
  <unknown>:1: DeprecationWarning: invalid escape sequence \.
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \?
  <unknown>:1: DeprecationWarning: invalid escape sequence \?
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \?
  <unknown>:1: DeprecationWarning: invalid escape sequence \?
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[
  <unknown>:1: DeprecationWarning: invalid escape sequence \[

```


Discussion:
Yes you need to double the backslash.

Resolving patch:
diff --git a/kinto/core/resource/__init__.py b/kinto/core/resource/__init__.py
--- a/kinto/core/resource/__init__.py
+++ b/kinto/core/resource/__init__.py
@@ -988,7 +988,7 @@ def _extract_filters(self):
                 filters.append(Filter(self.model.modified_field, value, operator))
                 continue
 
-            all_keywords = "|".join([i.name.lower() for i in COMPARISON])
+            all_keywords = r"|".join([i.name.lower() for i in COMPARISON])
             m = re.match(r"^(" + all_keywords + r")_([\w\.]+)$", param)
             if m:
                 keyword, field = m.groups()


Test patch: