--- a/mercurial/encoding.py Fri May 05 01:41:54 2017 +0530
+++ b/mercurial/encoding.py Wed May 03 15:37:51 2017 +0530
@@ -429,7 +429,7 @@
_jsonmap = []
_jsonmap.extend("\\u%04x" % x for x in range(32))
-_jsonmap.extend(chr(x) for x in range(32, 127))
+_jsonmap.extend(pycompat.bytechr(x) for x in range(32, 127))
_jsonmap.append('\\u007f')
_jsonmap[0x09] = '\\t'
_jsonmap[0x0a] = '\\n'
@@ -441,7 +441,7 @@
_paranoidjsonmap = _jsonmap[:]
_paranoidjsonmap[0x3c] = '\\u003c' # '<' (e.g. escape "</script>")
_paranoidjsonmap[0x3e] = '\\u003e' # '>'
-_jsonmap.extend(chr(x) for x in range(128, 256))
+_jsonmap.extend(pycompat.bytechr(x) for x in range(128, 256))
def jsonescape(s, paranoid=False):
'''returns a string suitable for JSON