Bug 2987 - passing a non-string to a string-expecting filter in a template crashes mercurial
Summary: passing a non-string to a string-expecting filter in a template crashes mercu...
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal feature
Assignee: Bugzilla
URL:
Keywords:
: 3096 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-07 04:59 UTC by Jan
Modified: 2012-12-19 20:56 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan 2011-09-07 04:59 UTC
Running "hg parent --template '{date|obfuscate}"' crashes with the 
following exception: 

** unknown exception encountered, please report by visiting
**  http://mercurial.selenic.com/wiki/BugTracker
** Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3]
** Mercurial Distributed SCM (version 1.9.2+3-86380f24e697)
** Extensions loaded: rebase, svn
Traceback (most recent call last):
[omitted traceback]
TypeError: coercing to Unicode: need string or buffer, tuple found


The same happens (with different exceptions) for other filters that expect 
string input if they aren't given strings. Hg should give a sensible error 
message instead of crashing. If this is not a bug but expected behaviour, 
it is a bug that mercurial instructs me to report this.

Related: Issue 2159
Comment 1 Bugzilla 2012-05-12 09:23 UTC

--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:23 EDT  ---

This bug was previously known as _bug_ 2987 at http://mercurial.selenic.com/bts/issue2987

Bug Status was UNCONFIRMED but everconfirmed was true
   Setting status to CONFIRMED

Comment 2 HG Bot 2012-08-24 17:02 UTC
Fixed by http://selenic.com/repo/hg/rev/099c778ceb33
Neil Kodner <neilk@fb.com>
templater: abort when a template filter raises an exception (issue2987)

(please test the fix)
Comment 3 Matt Mackall 2012-09-30 16:19 UTC
Mass close old bugs in testing.
Comment 4 Bryan O'Sullivan 2012-12-19 20:56 UTC
*** Bug 3096 has been marked as a duplicate of this bug. ***