# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2018-02-18 18:45:50 # Node ID a8bca9d0cea073cced6a5bfa03b0ae9a9af2feba # Parent 6d6bc544467a398ffb534e5353c1986fc4d3f74d py3: make sure regex is bytes in crecord.py # skip-blame because we are just adding b'' Differential Revision: https://phab.mercurial-scm.org/D2336 diff --git a/mercurial/crecord.py b/mercurial/crecord.py --- a/mercurial/crecord.py +++ b/mercurial/crecord.py @@ -950,7 +950,7 @@ class curseschunkselector(object): # preprocess the text, converting tabs to spaces text = text.expandtabs(4) # strip \n, and convert control characters to ^[char] representation - text = re.sub(r'[\x00-\x08\x0a-\x1f]', + text = re.sub(br'[\x00-\x08\x0a-\x1f]', lambda m:'^' + chr(ord(m.group()) + 64), text.strip('\n')) if pair is not None: