You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I received an e-mail without a body, just an attachment. Alot fails to open it.
Software Versions
Python version: 3.8.2
Notmuch version: 0.29.3
Alot version: master
To Reproduce
Steps to reproduce the behaviour:
try to open an e-mail without a body;
Alot fails to open it.
Error Log
Traceback (most recent call last):
File "/home/martins/code/alot/alot/ui.py", line 195, in _apply_fire
await self.apply_commandline(cmdline)
File "/home/martins/code/alot/alot/ui.py", line 283, in apply_commandline
self._error_handler(e)
File "/home/martins/code/alot/alot/ui.py", line 160, in _error_handler
self.notify(msg, priority='error')
File "/home/martins/code/alot/alot/ui.py", line 624, in notify
self.update()
File "/home/martins/code/alot/alot/ui.py", line 660, in update
lines.append(self.build_statusbar())
File "/home/martins/code/alot/alot/ui.py", line 677, in build_statusbar
info = cb.get_info()
File "/home/martins/code/alot/alot/buffers/thread.py", line 60, in get_info
self.get_selected_message().get_mime_part().get_content_type())
AttributeError: 'str' object has no attribute 'get_content_type'
I have a similar issue but presenting a different trace.. (also on a mail that was a 'blank' body - but had content in the attachments...
ERROR:ui:Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/alot-0.9.1-py3.9.egg/alot/ui.py", line 723, in apply_command
cmd.apply(self)
File "/usr/local/lib/python3.9/dist-packages/alot-0.9.1-py3.9.egg/alot/commands/search.py", line 43, in apply
tb.unfold_matching(query)
File "/usr/local/lib/python3.9/dist-packages/alot-0.9.1-py3.9.egg/alot/buffers/thread.py", line 341, in unfold_matching
MT.expand(MT.root)
File "/usr/local/lib/python3.9/dist-packages/alot-0.9.1-py3.9.egg/alot/widgets/thread.py", line 215, in expand
self.reassemble()
File "/usr/local/lib/python3.9/dist-packages/alot-0.9.1-py3.9.egg/alot/widgets/thread.py", line 189, in reassemble
self._maintree._treelist = self._assemble_structure()
File "/usr/local/lib/python3.9/dist-packages/alot-0.9.1-py3.9.egg/alot/widgets/thread.py", line 235, in _assemble_structure
bodytree = self._get_body()
File "/usr/local/lib/python3.9/dist-packages/alot-0.9.1-py3.9.egg/alot/widgets/thread.py", line 269, in _get_body
bodytxt = self._message.get_body_text()
File "/usr/local/lib/python3.9/dist-packages/alot-0.9.1-py3.9.egg/alot/db/message.py", line 287, in get_body_text
return extract_body_part(self.get_mime_part())
File "/usr/local/lib/python3.9/dist-packages/alot-0.9.1-py3.9.egg/alot/db/utils.py", line 499, in extract_body_part
**{'field_key': 'view'} if body_part.get_content_type() == 'text/plain'
AttributeError: 'str' object has no attribute 'get_content_type'
Describe the bug
I received an e-mail without a body, just an attachment. Alot fails to open it.
Software Versions
To Reproduce
Steps to reproduce the behaviour:
Error Log
This is due to this function:
alot/alot/db/utils.py
Lines 469 to 491 in 32b885d
Despite that
:rtype:
saysstr
, it normally returnsemail.message.EmailMessage
. And when there is no body it returns an empty string.Which fails in
alot/alot/buffers/thread.py
Lines 59 to 60 in 32b885d
via
alot/alot/db/message.py
Lines 277 to 280 in 32b885d
The text was updated successfully, but these errors were encountered: