diff -r 7654291091cf -r 8c8fcb385c46 mercurial/hook.py --- a/mercurial/hook.py Sat Dec 15 23:14:03 2018 -0500 +++ b/mercurial/hook.py Sun Dec 16 17:53:17 2018 +0900 @@ -102,7 +102,7 @@ (hname, exc.args[0])) else: ui.warn(_('error: %s hook raised an exception: ' - '%s\n') % (hname, encoding.strtolocal(str(exc)))) + '%s\n') % (hname, stringutil.forcebytestr(exc))) if throw: raise if not ui.tracebackflag: