diff options
| author | bwarsaw | 2002-11-18 06:15:20 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-11-18 06:15:20 +0000 |
| commit | 371d74f718cee5ad4f36f610628f8641a3fb4e8e (patch) | |
| tree | d9f682098f15fe2a19e352b85b43f14edd5806e9 | |
| parent | 0d1ba8239d1084aa8a664e3996bfa2200f10f866 (diff) | |
| download | mailman-371d74f718cee5ad4f36f610628f8641a3fb4e8e.tar.gz mailman-371d74f718cee5ad4f36f610628f8641a3fb4e8e.tar.zst mailman-371d74f718cee5ad4f36f610628f8641a3fb4e8e.zip | |
| -rw-r--r-- | Mailman/Utils.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py index 3226a154f..52ea90471 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -462,7 +462,13 @@ def maketext(templatefile, dict=None, raw=0, lang=None, mlist=None): text = template if dict is not None: try: - text = template % SafeDict(dict) + sdict = SafeDict(dict) + try: + text = sdict.interpolate(template) + except UnicodeError: + # Try again after coercing the template to unicode + utemplate = unicode(template, GetCharSet(lang), 'replace') + text = sdict.interpolate(utemplate) except (TypeError, ValueError): # The template is really screwed up pass |
