# HG changeset patch # User Yuya Nishihara # Date 2017-09-16 13:42:19 # Node ID 5307cc57f2719e7cd082a93dddcdbdde04f23ccf # Parent 1c601df9894c472ec730d14a2c8c8d3675bb5e8f py3: don't pass bytes to array.array() diff --git a/mercurial/pure/charencode.py b/mercurial/pure/charencode.py --- a/mercurial/pure/charencode.py +++ b/mercurial/pure/charencode.py @@ -74,6 +74,6 @@ def jsonescapeu8fallback(u8chars, parano else: jm = _jsonmap # non-BMP char is represented as UTF-16 surrogate pair - u16codes = array.array('H', u8chars.decode('utf-8').encode('utf-16')) + u16codes = array.array(r'H', u8chars.decode('utf-8').encode('utf-16')) u16codes.pop(0) # drop BOM return ''.join(jm[x] if x < 128 else '\\u%04x' % x for x in u16codes)