From 5ffa2bf96429ef320eef00d71364ffe4ec3d367b Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Fri, 31 Jan 2014 20:27:28 -0400 Subject: Restore expected TypeError. I must have removed this to get rid of a error with some test sample during the testing of the branch, but it's absolutely needed so that mime attachments get shown properly. If the TypeError raises inapropiately due to some malformed part_map, then we will have to catch it using a workaround somewhere else. --- mail/src/leap/mail/imap/messages.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mail') diff --git a/mail/src/leap/mail/imap/messages.py b/mail/src/leap/mail/imap/messages.py index 6ff39671..4a07ef77 100644 --- a/mail/src/leap/mail/imap/messages.py +++ b/mail/src/leap/mail/imap/messages.py @@ -299,7 +299,9 @@ class LeapMessage(fields, MailParser, MBoxParser): return fd # TODO refactor with getBodyFile in MessagePart + fd = StringIO.StringIO() + if self._bdoc is not None: bdoc_content = self._bdoc.content if empty(bdoc_content): @@ -456,8 +458,8 @@ class LeapMessage(fields, MailParser, MBoxParser): :rtype: Any object implementing C{IMessagePart}. :return: The specified sub-part. """ - #if not self.isMultipart(): - #raise TypeError + if not self.isMultipart(): + raise TypeError try: pmap_dict = self._get_part_from_parts_map(part + 1) except KeyError: -- cgit v1.2.3