logilab-common #3016 unknown encoding: unknown-8bit [resolved]

Some mails have weird headers:

while processing /home/logilab/prive/depomail/SOPX01.mbox
Traceback (most recent call last):
 File "/usr/bin/maboa-htmlize", line 13, in ?
   run()
 File "/usr/bin/maboa-htmlize", line 8, in run
   proc.process_mailbox(sys.argv[1])
 File "hg_public/maboa/htmlize.py", line 161, in process_mailbox
   for dir_name, msg_filename, html, attachments in self._iterate_mailbox(mbox, indexer):
 File "hg_public/maboa/htmlize.py", line 120, in _iterate_mailbox
   msg_dict = self._msg_to_dict(message)
 File "hg_public/maboa/htmlize.py", line 89, in _msg_to_dict
   body.append(part.get_payload(decode=True))
 File "hg_public/logilab/common/umessage.py", line 56, in get_payload
   return unicode(payload or '', message.get_content_charset()
LookupError: unknown encoding: unknown-8bit

maboa should not crash, but rather use a default encoding (e.g. iso-8859-1) in that case.

priorityimportant
typebug
done in0.21.0
load0.250
load left0.000
closed by<not specified>