From patchwork Sun Jan 14 20:13:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D1478: py3: cast error message to localstr in blackbox.py From: phabricator X-Patchwork-Id: 26746 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Sun, 14 Jan 2018 20:13:15 +0000 indygreg updated this revision to Diff 4823. indygreg edited the summary of this revision. indygreg retitled this revision from "py3: cast error message to bytes in blackbox.py" to "py3: cast error message to localstr in blackbox.py". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1478?vs=3718&id=4823 REVISION DETAIL https://phab.mercurial-scm.org/D1478 AFFECTED FILES hgext/blackbox.py CHANGE DETAILS To: indygreg, #hg-reviewers, yuja Cc: yuja, mercurial-devel diff --git a/hgext/blackbox.py b/hgext/blackbox.py --- a/hgext/blackbox.py +++ b/hgext/blackbox.py @@ -44,6 +44,7 @@ from mercurial.node import hex from mercurial import ( + encoding, registrar, ui as uimod, util, @@ -182,7 +183,7 @@ fp.write(fmt % args) except (IOError, OSError) as err: self.debug('warning: cannot write to blackbox.log: %s\n' % - err.strerror) + encoding.strtolocal(err.strerror)) # do not restore _bbinlog intentionally to avoid failed # logging again else: