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

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Sun Dec 15 23:12:31 EST 2019


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

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])



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


More information about the Mercurial-devel mailing list