From patchwork Fri Mar 2 19:51:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D2541: verify: fix exception formatting bug in Python 3 From: phabricator X-Patchwork-Id: 28707 Message-Id: <183cf0940a4c788f04960948ab96e5fd@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Fri, 2 Mar 2018 19:51:36 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHGd85ef895d5f6: verify: fix exception formatting bug in Python 3 (authored by durin42, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D2541?vs=6364&id=6370#toc REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2541?vs=6364&id=6370 REVISION DETAIL https://phab.mercurial-scm.org/D2541 AFFECTED FILES mercurial/verify.py CHANGE DETAILS To: durin42, #hg-reviewers, pulkit, yuja Cc: yuja, mercurial-devel diff --git a/mercurial/verify.py b/mercurial/verify.py --- a/mercurial/verify.py +++ b/mercurial/verify.py @@ -70,9 +70,10 @@ self.errors += 1 def exc(self, linkrev, msg, inst, filename=None): - if not str(inst): - inst = repr(inst) - self.err(linkrev, "%s: %s" % (msg, inst), filename) + fmsg = pycompat.bytestr(inst) + if not fmsg: + fmsg = pycompat.byterepr(inst) + self.err(linkrev, "%s: %s" % (msg, fmsg), filename) def checklog(self, obj, name, linkrev): if not len(obj) and (self.havecl or self.havemf):