Patchwork D2336: py3: make sure regex is bytes in crecord.py

login
register
mail settings
Submitter phabricator
Date Feb. 18, 2018, 8:46 p.m.
Message ID <dfea99124bf92fd276db8552e1f7ca98@localhost.localdomain>
Download mbox | patch
Permalink /patch/28123/
State Not Applicable
Headers show

Comments

phabricator - Feb. 18, 2018, 8:46 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGab5a86416485: py3: make sure regex is bytes in crecord.py (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2336?vs=5890&id=5893

REVISION DETAIL
  https://phab.mercurial-scm.org/D2336

AFFECTED FILES
  mercurial/crecord.py

CHANGE DETAILS




To: pulkit, #hg-reviewers, durin42
Cc: mercurial-devel

Patch

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -950,7 +950,7 @@ 
         # 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: