[PATCH 1 of 7] py3: make encoding.encoding unicodes to pass into encode()

Pulkit Goyal 7895pulkit at gmail.com
Wed May 3 09:59:20 UTC 2017


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1491629557 -19800
#      Sat Apr 08 11:02:37 2017 +0530
# Node ID 2069dd90c6afe4e13ab73cbbf572fd4b50680def
# Parent  5f8450df55625fb0be8e40eacb662717fef33de2
py3: make encoding.encoding unicodes to pass into encode()

diff -r 5f8450df5562 -r 2069dd90c6af mercurial/scmutil.py
--- a/mercurial/scmutil.py	Tue May 02 02:05:39 2017 +0200
+++ b/mercurial/scmutil.py	Sat Apr 08 11:02:37 2017 +0530
@@ -212,7 +212,8 @@
                 reason = inst.reason
             if isinstance(reason, unicode):
                 # SSLError of Python 2.7.9 contains a unicode
-                reason = reason.encode(encoding.encoding, 'replace')
+                reason = reason.encode(pycompat.sysstr(encoding.encoding),
+                                        'replace')
             ui.warn(_("abort: error: %s\n") % reason)
         elif (util.safehasattr(inst, "args")
               and inst.args and inst.args[0] == errno.EPIPE):


More information about the Mercurial-devel mailing list