[Python-apps-team] Bug#964501: alot: Fix mailcap rendering for e-mails without `Content-Type` header

Johannes 'josch' Schauer josch at debian.org
Wed Jul 8 06:04:59 BST 2020


Package: alot
Version: 0.9.1-1
Severity: normal

Hi,

currently, alot is unable to handle emails without a Content-Type
header (traceback at the end of this mail).

Luckily there is a patch that fixes this problem:

https://github.com/pazz/alot/commit/2348014eb6d654ef123c6c353d2dc4306f226305

Can we backport this patch?

If you don't have time in the next few days, then I can also do an NMU,
just tell me what works for you. :)

Thanks!

cheers, josch


Traceback (most recent call last):
  File "/home/josch/git/alot/alot/ui.py", line 277, in apply_commandline
    await apply_this_command(c)
  File "/home/josch/git/alot/alot/ui.py", line 725, in apply_command
    self._error_handler(e)
  File "/home/josch/git/alot/alot/ui.py", line 160, in _error_handler
    self.notify(msg, priority='error')
  File "/home/josch/git/alot/alot/ui.py", line 624, in notify
    self.update()
  File "/home/josch/git/alot/alot/ui.py", line 668, in update
    self.mainloop.draw_screen()
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 586, in draw_screen
    canvas = self._topmost_widget.render(self.screen_size, focus=True)
  File "/usr/lib/python3/dist-packages/urwid/widget.py", line 144, in cached_render
    canv = fn(self, size, focus=focus)
  File "/usr/lib/python3/dist-packages/urwid/decoration.py", line 226, in render
    canv = self._original_widget.render(size, focus=focus)
  File "/usr/lib/python3/dist-packages/urwid/widget.py", line 144, in cached_render
    canv = fn(self, size, focus=focus)
  File "/usr/lib/python3/dist-packages/urwid/container.py", line 1085, in render
    body = self.body.render((maxcol, maxrow-ftrim-htrim),
  File "/home/josch/git/alot/alot/buffers/buffer.py", line 19, in render
    return self.body.render(size, focus)
  File "/usr/lib/python3/dist-packages/urwid/widget.py", line 144, in cached_render
    canv = fn(self, size, focus=focus)
  File "/usr/lib/python3/dist-packages/urwid/listbox.py", line 470, in render
    middle, top, bottom = self.calculate_visible(
  File "/usr/lib/python3/dist-packages/urwid/listbox.py", line 356, in calculate_visible
    focus_widget, focus_pos = self._body.get_focus()
  File "/home/josch/git/alot/alot/walker.py", line 39, in get_focus
    return self._get_at_pos(self.focus)
  File "/home/josch/git/alot/alot/walker.py", line 72, in _get_at_pos
    widget = self._get_next_item()
  File "/home/josch/git/alot/alot/walker.py", line 85, in _get_next_item
    next_widget = self.containerclass(next_obj, **self.kwargs)
  File "/home/josch/git/alot/alot/widgets/search.py", line 26, in __init__
    self.rebuild()
  File "/home/josch/git/alot/alot/widgets/search.py", line 60, in rebuild
    width, part = build_text_part(partname, self.thread,
  File "/home/josch/git/alot/alot/widgets/search.py", line 145, in build_text_part
    content = prepare_string(name, thread, maxw)
  File "/home/josch/git/alot/alot/widgets/search.py", line 213, in prepare_string
    s = content(thread)
  File "/home/josch/git/alot/alot/widgets/search.py", line 188, in prepare_content_string
    lastcontent = ' '.join(m.get_body_text() for m in msgs)
  File "/home/josch/git/alot/alot/widgets/search.py", line 188, in <genexpr>
    lastcontent = ' '.join(m.get_body_text() for m in msgs)
  File "/home/josch/git/alot/alot/db/message.py", line 280, in get_body_text
    return extract_body_part(self.mime_part)
  File "/home/josch/git/alot/alot/db/utils.py", line 501, in extract_body_part
    rendered_payload = render_part(
  File "/home/josch/git/alot/alot/db/utils.py", line 368, in render_part
    parms = tuple('='.join(p) for p in part.get_params())
TypeError: 'NoneType' object is not iterable



More information about the Python-apps-team mailing list