This revision was automatically updated to reflect the committed changes. Closed by commit rHG44a519ec5077: py3: add b'' to make sure regex pattern are bytes in hgweb/webutil.py (authored by pulkit, committed by ).
REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2260?vs=5700&id=5715 REVISION DETAIL https://phab.mercurial-scm.org/D2260 AFFECTED FILES mercurial/hgweb/webutil.py CHANGE DETAILS diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py +++ b/mercurial/hgweb/webutil.py @@ -626,15 +626,15 @@ # delimiters. the replace format and flags are optional, but # delimiters are required. match = re.match( - r'^s%s(.+)(?:(?<=\\\\)|(?<!\\))%s(.*)%s([ilmsux])*$' + br'^s%s(.+)(?:(?<=\\\\)|(?<!\\))%s(.*)%s([ilmsux])*$' % (delim, delim, delim), pattern) if not match: repo.ui.warn(_("websub: invalid pattern for %s: %s\n") % (key, pattern)) continue # we need to unescape the delimiter for regexp and format - delim_re = re.compile(r'(?<!\\)\\%s' % delim) + delim_re = re.compile(br'(?<!\\)\\%s' % delim) regexp = delim_re.sub(unesc, match.group(1)) format = delim_re.sub(unesc, match.group(2)) To: pulkit, #hg-reviewers Cc: mercurial-devel _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel