summaryrefslogtreecommitdiff
path: root/Mailman/Handlers/Decorate.py
diff options
context:
space:
mode:
authorbwarsaw2001-08-29 18:38:58 +0000
committerbwarsaw2001-08-29 18:38:58 +0000
commitd9514107f416b538604addb13975edaa2c5e09f1 (patch)
tree0d5e18394eea7d96f202422a4fd516da0e2c78d5 /Mailman/Handlers/Decorate.py
parenta76b4562f0bd4de17918fc3d5e52350c25496ea2 (diff)
downloadmailman-d9514107f416b538604addb13975edaa2c5e09f1.tar.gz
mailman-d9514107f416b538604addb13975edaa2c5e09f1.tar.zst
mailman-d9514107f416b538604addb13975edaa2c5e09f1.zip
decorate(): String interpolation can throw either a ValueError /or/ a
TypeError, but only ValueError was being caught. This means stray %'s can still crash Mailman. Also, when interpolation fails, instead of using [INVALID FOOTER], return the raw footer text template.
Diffstat (limited to 'Mailman/Handlers/Decorate.py')
-rw-r--r--Mailman/Handlers/Decorate.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Mailman/Handlers/Decorate.py b/Mailman/Handlers/Decorate.py
index 96a591ec4..63c86e608 100644
--- a/Mailman/Handlers/Decorate.py
+++ b/Mailman/Handlers/Decorate.py
@@ -94,8 +94,8 @@ def decorate(mlist, template, what, extradict={}):
# Interpolate into the template
try:
text = (template % d).replace('\r\n', '\n')
- except ValueError, e:
+ except (ValueError, TypeError), e:
syslog('error', 'Exception while calculating %s:\n%s', what, e)
what = what.upper()
- text = _('[INVALID %(what)s]')
+ text = template
return text