Patchwork D2659: templater: show repr of string we're rejecting

login
register
mail settings
Submitter phabricator
Date March 4, 2018, 6:12 p.m.
Message ID <differential-rev-PHID-DREV-3jmy434x7g3hkg2aa4ge-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28955/
State Superseded
Headers show

Comments

phabricator - March 4, 2018, 6:12 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I feel like this should make it a little easier to hunt down problems.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2659

AFFECTED FILES
  mercurial/templater.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -1326,7 +1326,7 @@ 
         # 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__'):