From aca1c26fafc64c786185c1c05cf7653c3f59e1bd Mon Sep 17 00:00:00 2001 From: tkikuchi <> Date: Sat, 18 Sep 2004 06:51:47 +0000 Subject: More error handling for oneline(). --- Mailman/Utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Mailman') 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()) -- cgit v1.2.3