# HG changeset patch # User Augie Fackler # Date 2018-03-04 17:33:15 # Node ID e79adc12cde37689db72cf38e84fe28ce647ff14 # Parent a2fa51415ddc98e8f799c182ac1936be19bd7db9 templater: show repr of string we're rejecting I feel like this should make it a little easier to hunt down problems. Differential Revision: https://phab.mercurial-scm.org/D2659 diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -1326,7 +1326,7 @@ def _flatten(thing): # We can only hit this on Python 3, and it's here to guard # against infinite recursion. raise error.ProgrammingError('Mercurial IO including templates is done' - ' with bytes, not strings') + ' with bytes, not strings, got %r' % thing) elif thing is None: pass elif not util.safehasattr(thing, '__iter__'):