changeset 44135:ae596fac8ba0 stable

crecord: fix a concatenation of bytes and str on py3 Differential Revision: https://phab.mercurial-scm.org/D7970
author Kyle Lippincott <spectral@google.com>
date Tue, 21 Jan 2020 17:15:34 -0800
parents e96ed3a61899
children 50e7ce1f96d1 a90039b07343
files mercurial/crecord.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/crecord.py	Wed Jan 22 14:11:11 2020 -0500
+++ b/mercurial/crecord.py	Tue Jan 21 17:15:34 2020 -0800
@@ -24,6 +24,7 @@
     encoding,
     error,
     patch as patchmod,
+    pycompat,
     scmutil,
     util,
 )
@@ -1113,7 +1114,7 @@
         # strip \n, and convert control characters to ^[char] representation
         text = re.sub(
             br'[\x00-\x08\x0a-\x1f]',
-            lambda m: b'^' + chr(ord(m.group()) + 64),
+            lambda m: b'^' + pycompat.sysbytes(chr(ord(m.group()) + 64)),
             text.strip(b'\n'),
         )