encode the body of the messages, getting the content-type flag
During some changes, I temporarily commented the body encoding thinking that it was correctly encoded, but it's not. It needs to get the encoding back.
2014-01-13 14:55:11,178 - leap:write:L#53 - DEBUG - 2014-01-13 14:55:11-0300 [-] Unhandled error in Deferred: 2014-01-13 14:55:11,191 - leap:write:L#53 - DEBUG - 2014-01-13 14:55:11-0300 [-] Unhandled Error 2014-01-13 14:55:11,192 - leap:write:L#53 - DEBUG - Traceback (most recent call last): 2014-01-13 14:55:11,192 - leap:write:L#53 - DEBUG - File "/Users/chiiph/.virtualenvs/leap/lib/python2.7/site-packages/twisted/mail/imap4.py", line 2048, in spew 2014-01-13 14:55:11,193 - leap:write:L#53 - DEBUG - yield self.spew_body(part, id, msg, write, flush) 2014-01-13 14:55:11,193 - leap:write:L#53 - DEBUG - File "/Users/chiiph/.virtualenvs/leap/lib/python2.7/site-packages/twisted/mail/imap4.py", line 2025, in spew_body 2014-01-13 14:55:11,196 - leap:write:L#53 - DEBUG - return MessageProducer(msg, None, self._scheduler).beginProducing(self.transport) 2014-01-13 14:55:11,196 - leap:write:L#53 - DEBUG - File "/Users/chiiph/.virtualenvs/leap/lib/python2.7/site-packages/twisted/mail/imap4.py", line 5716, in beginProducing 2014-01-13 14:55:11,196 - leap:write:L#53 - DEBUG - return self.scheduler(self._produce()) 2014-01-13 14:55:11,197 - leap:write:L#53 - DEBUG - File "/Users/chiiph/.virtualenvs/leap/lib/python2.7/site-packages/twisted/mail/imap4.py", line 5689, in iterateInReactor 2014-01-13 14:55:11,197 - leap:write:L#53 - DEBUG - go(None) 2014-01-13 14:55:11,197 - leap:write:L#53 - DEBUG - --- --- 2014-01-13 14:55:11,197 - leap:write:L#53 - DEBUG - File "/Users/chiiph/.virtualenvs/leap/lib/python2.7/site-packages/twisted/mail/imap4.py", line 5679, in go 2014-01-13 14:55:11,198 - leap:write:L#53 - DEBUG - r = i.next() 2014-01-13 14:55:11,198 - leap:write:L#53 - DEBUG - File "/Users/chiiph/.virtualenvs/leap/lib/python2.7/site-packages/twisted/mail/imap4.py", line 5744, in _produce 2014-01-13 14:55:11,198 - leap:write:L#53 - DEBUG - f = self.msg.getBodyFile() 2014-01-13 14:55:11,198 - leap:write:L#53 - DEBUG - File "/Users/chiiph/Code/leap/leap_mail/src/leap/mail/imap/messages.py", line 489, in getBodyFile 2014-01-13 14:55:11,199 - leap:write:L#53 - DEBUG - body = str(self._bdoc.content.get(self.RAW_KEY, "")) 2014-01-13 14:55:11,199 - leap:write:L#53 - DEBUG - exceptions.UnicodeEncodeError: 'ascii' codec can't encode characters in position 28-29: ordinal not in range(128)
(from redmine: created on 2014-01-13, closed on 2014-01-14)