From 137c2f88f937aeb727f75883fda3c36988644f00 Mon Sep 17 00:00:00 2001 From: helmutm Date: Sun, 31 Jan 2010 12:43:39 +0000 Subject: [PATCH] handle empty message params correctly git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3700 fd906abe-77d9-0310-91a1-e0d9ade77398 --- integrator/mail/imap.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/integrator/mail/imap.py b/integrator/mail/imap.py index 5ab1757..f588b2d 100644 --- a/integrator/mail/imap.py +++ b/integrator/mail/imap.py @@ -129,4 +129,7 @@ def getText(msg): return msg.get_payload(decode=True).decode(getCharset(msg)) def getCharset(msg): - return dict(msg.get_params()).get('charset') or 'ISO8859-1' + params = msg.get_params() + if params: + return dict(params).get('charset') or 'ISO8859-1' + return 'ISO8859-1'