# HG changeset patch # User Mads Kiilerich # Date 1564870383 -7200 # Node ID f79b864dc192dd01a9f3e167c92b805c85e77ac8 # Parent fe4086096758acaada030816ebba4d65d324abdf flake8: fix W605 invalid escape sequence diff -r fe4086096758 -r f79b864dc192 kallithea/bin/kallithea_cli_ssh.py --- a/kallithea/bin/kallithea_cli_ssh.py Wed Aug 07 23:48:26 2019 +0200 +++ b/kallithea/bin/kallithea_cli_ssh.py Sun Aug 04 00:13:03 2019 +0200 @@ -52,7 +52,7 @@ os.environ['LANGUAGE'] = ssh_locale # trumps LC_ALL for GNU gettext message handling ssh_original_command = os.environ.get('SSH_ORIGINAL_COMMAND', '') - connection = re.search('^([\d\.]+)', os.environ.get('SSH_CONNECTION', '')) + connection = re.search(r'^([0-9.]+)', os.environ.get('SSH_CONNECTION', '')) client_ip = connection.group(1) if connection else '0.0.0.0' log.debug('ssh-serve was invoked for SSH command %r from %s', ssh_original_command, client_ip) diff -r fe4086096758 -r f79b864dc192 kallithea/config/routing.py --- a/kallithea/config/routing.py Wed Aug 07 23:48:26 2019 +0200 +++ b/kallithea/config/routing.py Sun Aug 04 00:13:03 2019 +0200 @@ -399,7 +399,7 @@ with rmap.submapper(path_prefix=ADMIN_PREFIX, controller='admin/admin') as m: m.connect('admin_home', '', action='index') - m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9\. _-]*}', + m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9. _-]*}', action='add_repo') #========================================================================== # API V2 diff -r fe4086096758 -r f79b864dc192 kallithea/lib/auth_modules/auth_pam.py --- a/kallithea/lib/auth_modules/auth_pam.py Wed Aug 07 23:48:26 2019 +0200 +++ b/kallithea/lib/auth_modules/auth_pam.py Sun Aug 04 00:13:03 2019 +0200 @@ -84,7 +84,7 @@ "type": "string", "description": "Regex for extracting user name/email etc " "from Unix userinfo", - "default": "(?P.+),\s*(?P\w+)", + "default": r"(?P.+),\s*(?P\w+)", "formname": "Gecos Regex" } ] diff -r fe4086096758 -r f79b864dc192 kallithea/lib/diffs.py --- a/kallithea/lib/diffs.py Wed Aug 07 23:48:26 2019 +0200 +++ b/kallithea/lib/diffs.py Sun Aug 04 00:13:03 2019 +0200 @@ -42,7 +42,7 @@ def _safe_id(idstring): - """Make a string safe for including in an id attribute. + r"""Make a string safe for including in an id attribute. The HTML spec says that id attributes 'must begin with a letter ([A-Za-z]) and may be followed by any number diff -r fe4086096758 -r f79b864dc192 kallithea/lib/helpers.py --- a/kallithea/lib/helpers.py Wed Aug 07 23:48:26 2019 +0200 +++ b/kallithea/lib/helpers.py Sun Aug 04 00:13:03 2019 +0200 @@ -1073,7 +1073,7 @@ return '
see => %s
' % seen license = match_obj.group('license') if license: - return '' % (license, license) + return '' % (license, license) tagtype = match_obj.group('tagtype') if tagtype: tagvalue = match_obj.group('tagvalue') diff -r fe4086096758 -r f79b864dc192 kallithea/lib/markup_renderer.py --- a/kallithea/lib/markup_renderer.py Wed Aug 07 23:48:26 2019 +0200 +++ b/kallithea/lib/markup_renderer.py Sun Aug 04 00:13:03 2019 +0200 @@ -90,7 +90,7 @@ def italic_callback(matchobj): s = matchobj.group(0) if list(s).count('_') >= 2: - return s.replace('_', '\_') + return s.replace('_', r'\_') return s text = re.sub(r'^(?! {4}|\t)\w+_\w+_\w[\w_]*', italic_callback, text) @@ -243,6 +243,6 @@ def wrapp(match_obj): uname = match_obj.groups()[0] - return '\ **@%(uname)s**\ ' % {'uname': uname} + return r'\ **@%(uname)s**\ ' % {'uname': uname} mention_hl = MENTIONS_REGEX.sub(wrapp, source).strip() return cls.rst(mention_hl) diff -r fe4086096758 -r f79b864dc192 kallithea/lib/utils.py --- a/kallithea/lib/utils.py Wed Aug 07 23:48:26 2019 +0200 +++ b/kallithea/lib/utils.py Sun Aug 04 00:13:03 2019 +0200 @@ -411,10 +411,10 @@ from kallithea.config import conf log.debug('adding extra into INDEX_EXTENSIONS') - conf.INDEX_EXTENSIONS.extend(re.split('\s+', config.get('index.extensions', ''))) + conf.INDEX_EXTENSIONS.extend(re.split(r'\s+', config.get('index.extensions', ''))) log.debug('adding extra into INDEX_FILENAMES') - conf.INDEX_FILENAMES.extend(re.split('\s+', config.get('index.filenames', ''))) + conf.INDEX_FILENAMES.extend(re.split(r'\s+', config.get('index.filenames', ''))) def map_groups(path): @@ -592,7 +592,7 @@ stdout, stderr = GitRepository._run_git_command(['--version'], _bare=True, _safe=True) - m = re.search("\d+.\d+.\d+", stdout) + m = re.search(r"\d+.\d+.\d+", stdout) if m: ver = StrictVersion(m.group(0)) else: diff -r fe4086096758 -r f79b864dc192 kallithea/lib/utils2.py --- a/kallithea/lib/utils2.py Wed Aug 07 23:48:26 2019 +0200 +++ b/kallithea/lib/utils2.py Sun Aug 04 00:13:03 2019 +0200 @@ -679,7 +679,7 @@ slug = remove_formatting(value) slug = strip_tags(slug) - for c in """`?=[]\;'"<>,/~!@#$%^&*()+{}|: """: + for c in r"""`?=[]\;'"<>,/~!@#$%^&*()+{}|: """: slug = slug.replace(c, '-') slug = recursive_replace(slug, '-') slug = collapse(slug, '-')