changeset 34808:e87e62b7fc0b

templater: don't blow up when trying to build an abort message __name__ is unicode, but we need bytes. For now, we'll make the (mostly-safe) assumption that template filter names will be ascii. Differential Revision: https://phab.mercurial-scm.org/D1137
author Augie Fackler <augie@google.com>
date Mon, 16 Oct 2017 22:50:39 -0400
parents 3caec3c032c8
children 3a65012be661
files mercurial/templater.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templater.py	Mon Oct 16 22:44:06 2017 -0400
+++ b/mercurial/templater.py	Mon Oct 16 22:50:39 2017 -0400
@@ -427,7 +427,7 @@
         sym = findsymbolicname(arg)
         if sym:
             msg = (_("template filter '%s' is not compatible with keyword '%s'")
-                   % (filt.__name__, sym))
+                   % (filt.__name__.encode('ascii'), sym))
         else:
             msg = _("incompatible use of template filter '%s'") % filt.__name__
         raise error.Abort(msg)