pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Uses pycompat.sysstr() to make sure we uses bytes on Python 2 and unicodes on
  Python 3.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3279

AFFECTED FILES
  hgext/convert/common.py

CHANGE DETAILS

diff --git a/hgext/convert/common.py b/hgext/convert/common.py
--- a/hgext/convert/common.py
+++ b/hgext/convert/common.py
@@ -217,12 +217,13 @@
         if isinstance(s, unicode):
             return s.encode("utf-8")
         try:
-            return s.decode(encoding).encode("utf-8")
+            return s.decode(pycompat.sysstr(encoding)).encode("utf-8")
         except UnicodeError:
             try:
                 return s.decode("latin-1").encode("utf-8")
             except UnicodeError:
-                return s.decode(encoding, "replace").encode("utf-8")
+                return s.decode(pycompat.sysstr(encoding),
+                                "replace").encode("utf-8")
 
     def getchangedfiles(self, rev, i):
         """Return the files changed by rev compared to parent[i].



To: pulkit, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to