mercurial/dispatch.py
branchstable
changeset 24152 97a548aeb749
parent 23871 b2d8f3685b06
child 24163 bb11081562d7
--- a/mercurial/dispatch.py	Thu Feb 05 14:45:49 2015 +0900
+++ b/mercurial/dispatch.py	Thu Feb 26 23:30:33 2015 +0900
@@ -230,6 +230,9 @@
             except (AttributeError, IndexError):
                 # it might be anything, for example a string
                 reason = inst.reason
+            if isinstance(reason, unicode):
+                # SSLError of Python 2.7.9 contains a unicode
+                reason = reason.encode(encoding.encoding, 'replace')
             ui.warn(_("abort: error: %s\n") % reason)
         elif (util.safehasattr(inst, "args")
               and inst.args and inst.args[0] == errno.EPIPE):