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