# HG changeset patch # User Gregory Szorc # Date 1515960387 28800 # 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 -r 2c6ebd0c850e -r de598e84c244 hgext/blackbox.py --- a/hgext/blackbox.py Wed Jan 10 21:27:05 2018 -0800 +++ b/hgext/blackbox.py Sun Jan 14 12:06:27 2018 -0800 @@ -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: