# HG changeset patch # User Matt Harbison # Date 2019-12-14 23:31:50 # Node ID e63b27fb0595ecbeaae7738c7938131c499fea11 # Parent e5f69e3bb3f61a5f7d3525094450ed41bd3f70a8 ui: convert exception data to bytes when printing chained exception info Caught by pytype. Differential Revision: https://phab.mercurial-scm.org/D7670 diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -1857,9 +1857,9 @@ class ui(object): # exclude frame where 'exc' was chained and rethrown from exctb self.write_err( b'Traceback (most recent call last):\n', - b''.join(exctb[:-1]), - b''.join(causetb), - b''.join(exconly), + encoding.strtolocal(''.join(exctb[:-1])), + encoding.strtolocal(''.join(causetb)), + encoding.strtolocal(''.join(exconly)), ) else: output = traceback.format_exception(exc[0], exc[1], exc[2])