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

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Sun Mar 4 18:12:26 UTC 2018


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

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__'):



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


More information about the Mercurial-devel mailing list