aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman
diff options
context:
space:
mode:
authortkikuchi <>2004-09-18 06:51:47 +0000
committertkikuchi <>2004-09-18 06:51:47 +0000
commitaca1c26fafc64c786185c1c05cf7653c3f59e1bd (patch)
tree3513d293a46dfd546c65c535d5ac49e51a1010ab /Mailman
parent5e8bced3fc185b9919d943adbb15afafadfcc4bb (diff)
downloadmailman2-aca1c26fafc64c786185c1c05cf7653c3f59e1bd.tar.gz
mailman2-aca1c26fafc64c786185c1c05cf7653c3f59e1bd.tar.xz
mailman2-aca1c26fafc64c786185c1c05cf7653c3f59e1bd.zip
More error handling for oneline().
Diffstat (limited to 'Mailman')
-rw-r--r--Mailman/Utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py
index 54e63ddf..dda90354 100644
--- a/Mailman/Utils.py
+++ b/Mailman/Utils.py
@@ -36,6 +36,7 @@ import cgi
import htmlentitydefs
import email.Header
import email.Iterators
+from email.Errors import HeaderParseError
from types import UnicodeType
from string import whitespace, digits
try:
@@ -816,6 +817,6 @@ def oneline(s, cset):
ustr = h.__unicode__()
line = UEMPTYSTRING.join(ustr.splitlines())
return line.encode(cset, 'replace')
- except (LookupError, UnicodeError):
+ except (LookupError, UnicodeError, ValueError, HeaderParseError):
# possibly charset problem. return with undecoded string in one line.
return EMPTYSTRING.join(s.splitlines())