summaryrefslogtreecommitdiff
path: root/Mailman/Utils.py
diff options
context:
space:
mode:
authorbwarsaw2002-11-18 06:15:20 +0000
committerbwarsaw2002-11-18 06:15:20 +0000
commit371d74f718cee5ad4f36f610628f8641a3fb4e8e (patch)
treed9f682098f15fe2a19e352b85b43f14edd5806e9 /Mailman/Utils.py
parent0d1ba8239d1084aa8a664e3996bfa2200f10f866 (diff)
downloadmailman-371d74f718cee5ad4f36f610628f8641a3fb4e8e.tar.gz
mailman-371d74f718cee5ad4f36f610628f8641a3fb4e8e.tar.zst
mailman-371d74f718cee5ad4f36f610628f8641a3fb4e8e.zip
Diffstat (limited to 'Mailman/Utils.py')
-rw-r--r--Mailman/Utils.py8
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