aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman
diff options
context:
space:
mode:
authorMark Sapiro <msapiro@value.net>2010-09-07 13:10:57 -0700
committerMark Sapiro <msapiro@value.net>2010-09-07 13:10:57 -0700
commit7422edc8142b8b199fd78d75c80d631603555722 (patch)
tree14f030cc596b4a960297cb21c2b5d20d7d2008d0 /Mailman
parent39e51a6f72f1fb9cfb093e7ff3363dd11d405776 (diff)
downloadmailman2-7422edc8142b8b199fd78d75c80d631603555722.tar.gz
mailman2-7422edc8142b8b199fd78d75c80d631603555722.tar.xz
mailman2-7422edc8142b8b199fd78d75c80d631603555722.zip
Fixed i18n._() to catch exceptions due to bad formats. Bug #632660.
Diffstat (limited to 'Mailman')
-rw-r--r--Mailman/i18n.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Mailman/i18n.py b/Mailman/i18n.py
index 7fe3b7ce..c2d0896c 100644
--- a/Mailman/i18n.py
+++ b/Mailman/i18n.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2000-2006 by the Free Software Foundation, Inc.
+# Copyright (C) 2000-2010 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -87,7 +87,11 @@ def _(s):
for k, v in dict.items():
if isinstance(v, UnicodeType):
dict[k] = v.encode(charset, 'replace')
- return tns % dict
+ try:
+ return tns % dict
+ except (ValueError, KeyError, TypeError):
+ # Bad interpolation format. Punt.
+ return tns