# HG changeset patch # User Augie Fackler # Date 2018-02-26 03:30:14 # Node ID 1df7e7b8558e34440cd9f1bf6eb691260869fd40 # Parent a39126a40be6cf77a733df0dd83a3a970f13482d subrepo: use util.forcebytestr() instead of str() on exception Differential Revision: https://phab.mercurial-scm.org/D2437 diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -73,7 +73,8 @@ def annotatesubrepoerror(func): raise ex except error.Abort as ex: subrepo = subrelpath(self) - errormsg = str(ex) + ' ' + _('(in subrepository "%s")') % subrepo + errormsg = (util.forcebytestr(ex) + ' ' + + _('(in subrepository "%s")') % subrepo) # avoid handling this exception by raising a SubrepoAbort exception raise SubrepoAbort(errormsg, hint=ex.hint, subrepo=subrepo, cause=sys.exc_info())