diff mercurial/scmutil.py @ 32152:994b0b1c77d6

py3: use encoding.unitolocal instead of .encode(encoding.encoding)
author Pulkit Goyal <7895pulkit@gmail.com>
date Sat, 08 Apr 2017 11:02:37 +0530
parents ef966bcf48a5
children 448ed4d3ee90
line wrap: on
line diff
--- 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):