Skip to content

Commit

Permalink
Fix DeprecationWarning for unrecognized backslash escapes
Browse files Browse the repository at this point in the history
This became a warning as of Python 3.6 -- see
https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior.
  • Loading branch information
glasserc committed Sep 10, 2018
1 parent 15f534b commit 5406982
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions kinto/core/resource/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,8 +992,8 @@ def _extract_filters(self):
)
continue

allKeywords = '|'.join([i.name.lower() for i in COMPARISON])
m = re.match(r'^('+allKeywords+')_([\w\.]+)$', param)
allkeywords = '|'.join([i.name.lower() for i in COMPARISON])
m = re.match(r'^(' + all_keywords + r')_([\w\.]+)$', param)
if m:
keyword, field = m.groups()
operator = getattr(COMPARISON, keyword.upper())
Expand Down
2 changes: 1 addition & 1 deletion kinto/core/resource/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def op_validator():
return colander.OneOf(op_values)

def path_validator():
return colander.Regex('(/\w*)+')
return colander.Regex('(/\\w*)+')

op = colander.SchemaNode(colander.String(), validator=op_validator())
path = colander.SchemaNode(colander.String(), validator=path_validator())
Expand Down
2 changes: 1 addition & 1 deletion kinto/core/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class HeaderQuotedInteger(HeaderField):

schema_type = colander.String
error_message = 'The value should be integer between double quotes.'
validator = colander.Regex('^"([0-9]+?)"$|\*', msg=error_message)
validator = colander.Regex('^"([0-9]+?)"$|\\*', msg=error_message)

def deserialize(self, cstruct=colander.null):
param = super(HeaderQuotedInteger, self).deserialize(cstruct)
Expand Down

0 comments on commit 5406982

Please sign in to comment.