changeset 32643:3ce53a499334

dispatch: convert exception payload to bytes more carefully We were previously depending on str() doing something reasonable here, and we can't depend on the objects in question supporting __bytes__, so we work around the lack of direct bytes formatting.
author Augie Fackler <raf@durin42.com>
date Sun, 28 May 2017 15:47:00 -0400
parents d110fb58424c
children c59451e11cbf
files mercurial/dispatch.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dispatch.py	Sun May 28 15:49:29 2017 -0400
+++ b/mercurial/dispatch.py	Sun May 28 15:47:00 2017 -0400
@@ -319,7 +319,8 @@
     except error.CommandError as inst:
         if inst.args[0]:
             ui.pager('help')
-            ui.warn(_("hg %s: %s\n") % (inst.args[0], inst.args[1]))
+            msgbytes = pycompat.bytestr(inst.args[1])
+            ui.warn(_("hg %s: %s\n") % (inst.args[0], msgbytes))
             commands.help_(ui, inst.args[0], full=False, command=True)
         else:
             ui.pager('help')