# HG changeset patch # User Yuya Nishihara # Date 1504421669 -32400 # Node ID 1c601df9894c472ec730d14a2c8c8d3675bb5e8f # Parent b4abc438a8c92dc2ed2401d90efe082249604589 py3: wrap bytes in encoding.from/toutf8b() with bytestr diff --git a/mercurial/encoding.py b/mercurial/encoding.py --- a/mercurial/encoding.py +++ b/mercurial/encoding.py @@ -508,6 +508,7 @@ except UnicodeDecodeError: pass + s = pycompat.bytestr(s) r = "" pos = 0 l = len(s) @@ -560,6 +561,7 @@ # points to be escaped. Instead, we use our handy getutf8char # helper again to walk the string without "decoding" it. + s = pycompat.bytestr(s) r = "" pos = 0 l = len(s)