mercurial/encoding.py
changeset 34216 1c601df9894c
parent 34200 112f118ecb00
child 34218 aa877860d4d7
--- 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)