changeset 34223:1c601df9894c

py3: wrap bytes in encoding.from/toutf8b() with bytestr
author Yuya Nishihara <yuya@tcha.org>
date Sun, 03 Sep 2017 15:54:29 +0900
parents b4abc438a8c9
children 5307cc57f271
files mercurial/encoding.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/encoding.py	Sun Sep 03 17:28:47 2017 +0900
+++ b/mercurial/encoding.py	Sun Sep 03 15:54:29 2017 +0900
@@ -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)