# HG changeset patch # User Augie Fackler # Date 2017-03-03 18:29:50 # Node ID 27e3b66ec7c57409d2df04381458c9bebd4355d6 # Parent 49ad6bf6310794f755fed13a4360b0e9464006e3 dispatch: cope with sys.version being unicode on Python 3 diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -893,7 +893,12 @@ def _exceptionwarning(ui): bugtracker = _("https://mercurial-scm.org/wiki/BugTracker") warning = (_("** unknown exception encountered, " "please report by visiting\n** ") + bugtracker + '\n') - warning += ((_("** Python %s\n") % sys.version.replace('\n', '')) + + if pycompat.ispy3: + sysversion = sys.version.encode(u'utf-8') + else: + sysversion = sys.version + sysversion = sysversion.replace('\n', '') + warning += ((_("** Python %s\n") % sysversion) + (_("** Mercurial Distributed SCM (version %s)\n") % util.version()) + (_("** Extensions loaded: %s\n") %