py3: use encoding.unitolocal instead of .encode(encoding.encoding)
authorPulkit Goyal <7895pulkit@gmail.com>
Sat, 08 Apr 2017 11:02:37 +0530
changeset 32152 994b0b1c77d6
parent 32151 4d504e541d3d
child 32153 6f173560c7f4
py3: use encoding.unitolocal instead of .encode(encoding.encoding)
mercurial/scmutil.py
--- a/mercurial/scmutil.py	Wed May 03 10:43:59 2017 -0700
+++ b/mercurial/scmutil.py	Sat Apr 08 11:02:37 2017 +0530
@@ -212,7 +212,7 @@
                 reason = inst.reason
             if isinstance(reason, unicode):
                 # SSLError of Python 2.7.9 contains a unicode
-                reason = reason.encode(encoding.encoding, 'replace')
+                reason = encoding.unitolocal(reason)
             ui.warn(_("abort: error: %s\n") % reason)
         elif (util.safehasattr(inst, "args")
               and inst.args and inst.args[0] == errno.EPIPE):