diff --git a/mercurial/byterange.py b/mercurial/byterange.py --- a/mercurial/byterange.py +++ b/mercurial/byterange.py @@ -416,7 +416,7 @@ if range_header is None: return None if _rangere is None: - _rangere = re.compile(r'^bytes=(\d{1,})-(\d*)') + _rangere = re.compile(br'^bytes=(\d{1,})-(\d*)') match = _rangere.match(range_header) if match: tup = range_tuple_normalize(match.group(1, 2)) diff --git a/mercurial/mdiff.py b/mercurial/mdiff.py --- a/mercurial/mdiff.py +++ b/mercurial/mdiff.py @@ -100,7 +100,7 @@ if blank and opts.ignoreblanklines: text = re.sub('\n+', '\n', text).strip('\n') if opts.ignorewseol: - text = re.sub(r'[ \t\r\f]+\n', r'\n', text) + text = re.sub(br'[ \t\r\f]+\n', r'\n', text) return text def splitblock(base1, lines1, base2, lines2, opts):