From patchwork Wed May 3 09:59:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1,of,7] py3: make encoding.encoding unicodes to pass into encode() From: Pulkit Goyal <7895pulkit@gmail.com> X-Patchwork-Id: 20396 Message-Id: <2069dd90c6afe4e13ab7.1493805560@pulkit-goyal> To: mercurial-devel@mercurial-scm.org Date: Wed, 03 May 2017 15:29:20 +0530 # HG changeset patch # User Pulkit Goyal <7895pulkit@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):