At the cost of a modest (but useful in its own right) change in the semantics
of the Template.delimiter attribute, we make use of the delimiter in the
escaped group, and in the safe_substitute() method more robust.

Now, .delimiter should be the unescaped delimiter literal, e.g. '$' or '&', or
whatever.  The _TemplateMetaclass will re.escape() this value when it builds
the pattern.
1 file changed