From e7a093f55df2a5b5d1085618f66c807bc85b7b03 Mon Sep 17 00:00:00 2001 From: Jefferson Stachelski Date: Mon, 18 Jan 2016 18:20:48 -0200 Subject: Some work around that fixed jeffhsta wazokazi account --- service/pixelated/adapter/mailstore/body_parser.py | 3 +-- service/pixelated/adapter/search/__init__.py | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'service/pixelated/adapter') diff --git a/service/pixelated/adapter/mailstore/body_parser.py b/service/pixelated/adapter/mailstore/body_parser.py index a6017833..7fb084af 100644 --- a/service/pixelated/adapter/mailstore/body_parser.py +++ b/service/pixelated/adapter/mailstore/body_parser.py @@ -40,8 +40,7 @@ class BodyParser(object): text = self._serialize_for_parser(charset) decoded_body = self._parse_and_decode(text) - - return unicode(decoded_body, encoding=charset) + return unicode(decoded_body, charset, errors='replace') def _parse_and_decode(self, text): parsed_body = Parser().parsestr(text) diff --git a/service/pixelated/adapter/search/__init__.py b/service/pixelated/adapter/search/__init__.py index dbd4d288..35087101 100644 --- a/service/pixelated/adapter/search/__init__.py +++ b/service/pixelated/adapter/search/__init__.py @@ -115,8 +115,9 @@ class SearchEngine(object): return FileIndex.create(storage, self._mail_schema(), indexname='mails') def index_mail(self, mail): - with AsyncWriter(self._index) as writer: - self._index_mail(writer, mail) + if mail is not None: + with AsyncWriter(self._index) as writer: + self._index_mail(writer, mail) def _index_mail(self, writer, mail): mdict = mail.as_dict() -- cgit v1.2.3