# HG changeset patch # User Gregory Szorc # Date 2018-01-14 20:06:27 # Node ID de598e84c24421a6451db9dca73f506f103a593a # Parent 2c6ebd0c850eb4c79a50b70431d200deccccd824 py3: cast error message to localstr in blackbox.py According to the exceptions reporting mechanism, this is the #1 crasher in the test harness for Python 3. Since this exception is in an except block, we'll likely get a new #1 crasher after this change. But at least we won't die during error handling! Differential Revision: https://phab.mercurial-scm.org/D1478 diff --git a/hgext/blackbox.py b/hgext/blackbox.py --- a/hgext/blackbox.py +++ b/hgext/blackbox.py @@ -44,6 +44,7 @@ from mercurial.i18n import _ from mercurial.node import hex from mercurial import ( + encoding, registrar, ui as uimod, util, @@ -182,7 +183,7 @@ def wrapui(ui): 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: