# HG changeset patch # User Kyle Lippincott # Date 2020-01-22 01:15:34 # Node ID 43410ec7462b399a85222870c59485e13e15e704 # Parent 00aaf11ec39993617885f24ac45c208d9db297d3 crecord: fix a concatenation of bytes and str on py3 Differential Revision: https://phab.mercurial-scm.org/D7970 diff --git a/mercurial/crecord.py b/mercurial/crecord.py --- a/mercurial/crecord.py +++ b/mercurial/crecord.py @@ -24,6 +24,7 @@ from . import ( encoding, error, patch as patchmod, + pycompat, scmutil, util, ) @@ -1113,7 +1114,7 @@ class curseschunkselector(object): # 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'), )