changeset 35667:de598e84c244

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
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 14 Jan 2018 12:06:27 -0800
parents 2c6ebd0c850e
children 67cead0eb671
files hgext/blackbox.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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: