Patchwork D7670: ui: convert exception data to bytes when printing chained exception info

login
register
mail settings
Submitter phabricator
Date Dec. 16, 2019, 4:12 a.m.
Message ID <differential-rev-PHID-DREV-os2jl23afapxo3tf34ej-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43844/
State Superseded
Headers show

Comments

phabricator - Dec. 16, 2019, 4:12 a.m.
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Caught by pytype.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7670

AFFECTED FILES
  mercurial/ui.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1857,9 +1857,9 @@ 
                 # 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])