# HG changeset patch # User Nsukami Patrick # Date 1555562074 0 # Node ID d06a2feae373d5460a263f9a5abc6d0af3480dc9 # Parent 3aa0c203747c8d53f5539d6ea7ee1bbd78dd7126 Fix DeprecationWarning: invalid escape sequence diff -r 3aa0c203747c -r d06a2feae373 cubicweb/cwconfig.py --- a/cubicweb/cwconfig.py Wed Apr 10 17:59:17 2019 +0000 +++ b/cubicweb/cwconfig.py Thu Apr 18 04:34:34 2019 +0000 @@ -205,7 +205,7 @@ def possible_configurations(directory): """return a list of installed configurations in a directory - according to \*-ctl files + according to *-ctl files """ return [name for name in ('repository', 'all-in-one', 'pyramid') if exists(join(directory, '%s.conf' % name))] @@ -1149,7 +1149,7 @@ """return available translation for an instance, by looking for compiled catalog - take \*args to be usable as a vocabulary method + take *args to be usable as a vocabulary method """ from glob import glob yield 'en' # ensure 'en' is yielded even if no .mo found diff -r 3aa0c203747c -r d06a2feae373 cubicweb/devtools/devctl.py --- a/cubicweb/devtools/devctl.py Wed Apr 10 17:59:17 2019 +0000 +++ b/cubicweb/devtools/devctl.py Thu Apr 18 04:34:34 2019 +0000 @@ -786,7 +786,7 @@ continue try: rql, time = line.split('--') - rql = re.sub("(\'\w+': \d*)", '', rql) + rql = re.sub(r"(\'\w+': \d*)", '', rql) if '{' in rql: rql = rql[:rql.index('{')] req = requests.setdefault(rql, []) diff -r 3aa0c203747c -r d06a2feae373 cubicweb/multipart.py --- a/cubicweb/multipart.py Wed Apr 10 17:59:17 2019 +0000 +++ b/cubicweb/multipart.py Thu Apr 18 04:34:34 2019 +0000 @@ -101,10 +101,10 @@ ############################################################################## _special = re.escape('()<>@,;:\\"/[]?={} \t') -_re_special = re.compile('[%s]' % _special) +_re_special = re.compile(r'[%s]' % _special) _qstr = '"(?:\\\\.|[^"])*"' # Quoted string _value = '(?:[^%s]+|%s)' % (_special, _qstr) # Save or quoted string -_option = '(?:;|^)\s*([^%s]+)\s*=\s*(%s)' % (_special, _value) +_option = r'(?:;|^)\s*([^%s]+)\s*=\s*(%s)' % (_special, _value) _re_option = re.compile(_option) # key=value part of an Content-Type like header def header_quote(val): diff -r 3aa0c203747c -r d06a2feae373 cubicweb/server/hook.py --- a/cubicweb/server/hook.py Wed Apr 10 17:59:17 2019 +0000 +++ b/cubicweb/server/hook.py Thu Apr 18 04:34:34 2019 +0000 @@ -439,7 +439,7 @@ named parameters `frometypes` and `toetypes` can be used to restrict target subject and/or object entity types of the relation. - :param \*expected: possible relation types + :param *expected: possible relation types :param frometypes: candidate entity types as subject of relation :param toetypes: candidate entity types as object of relation """ diff -r 3aa0c203747c -r d06a2feae373 cubicweb/web/httpcache.py --- a/cubicweb/web/httpcache.py Wed Apr 10 17:59:17 2019 +0000 +++ b/cubicweb/web/httpcache.py Thu Apr 18 04:34:34 2019 +0000 @@ -121,7 +121,7 @@ """return the date/time where this view should be considered as modified. Take care of possible related objects modifications. - /!\ must return GMT time /!\ + /!\\ must return GMT time /!\\ """ # XXX check view module's file modification time in dev mod ? ctime = datetime.utcnow() diff -r 3aa0c203747c -r d06a2feae373 cubicweb/web/propertysheet.py --- a/cubicweb/web/propertysheet.py Wed Apr 10 17:59:17 2019 +0000 +++ b/cubicweb/web/propertysheet.py Thu Apr 18 04:34:34 2019 +0000 @@ -47,7 +47,7 @@ self.reset() context['sheet'] = self context['lazystr'] = self.lazystr - self._percent_rgx = re.compile('%(?!\()') + self._percent_rgx = re.compile(r'%(?!\()') def lazystr(self, str): return lazystr(str, self) diff -r 3aa0c203747c -r d06a2feae373 cubicweb/web/views/magicsearch.py --- a/cubicweb/web/views/magicsearch.py Wed Apr 10 17:59:17 2019 +0000 +++ b/cubicweb/web/views/magicsearch.py Thu Apr 18 04:34:34 2019 +0000 @@ -96,7 +96,7 @@ def resolve_ambiguities(var_types, ambiguous_nodes, schema): """Tries to resolve remaining ambiguities for translation - /!\ An ambiguity is when two different string can be localized with + /!\\ An ambiguity is when two different string can be localized with the same string A simple example: - 'name' in a company context will be localized as 'nom' in French diff -r 3aa0c203747c -r d06a2feae373 cubicweb/wsgi/request.py --- a/cubicweb/wsgi/request.py Wed Apr 10 17:59:17 2019 +0000 +++ b/cubicweb/wsgi/request.py Thu Apr 18 04:34:34 2019 +0000 @@ -87,7 +87,7 @@ # robust against potentially malformed input. form = pformat(self.form) meta = pformat(self.environ) - return '' % \ + return '' % \ (form, meta) ## cubicweb request interface ################################################