Closed kbingham closed 2 years ago
(Pdb) list
48 elif subject_type == 'oldest':
49 try:
50 >> first_msg = list(thread.get_toplevel_messages())[0]
51 subject = first_msg.get_header('subject')
52 except IndexError:
53 -> subject = ''
54 self._subject = subject
55
56 self._authors = None
57 ts = thread.first
58
As far as I can tell the first_msg = list(thread.get_toplevel_messages())[0]
may be a left over that hasn't yet been ported to the new notmuch2 bindings.
I tried making it call self.get_toplevel_messages() - but that fails.
More investigation needed.
This seems to fix it:
--- a/alot/db/thread.py
+++ b/alot/db/thread.py
@@ -47,8 +47,8 @@ class Thread:
subject = thread.subject
elif subject_type == 'oldest':
try:
- first_msg = list(thread.get_toplevel_messages())[0]
- subject = first_msg.get_header('subject')
+ first_msg = list(thread.toplevel())[0]
+ subject = first_msg.header('subject')
except IndexError:
subject = ''
self._subject = subject
Awesome thanks for the guidance. Is there documentation for the notmuch2 bindings? I could only see that they were from cffi so auto-generated ...
Thanks - that's confirmed working here. Now spotted more behaviour changes on master but those are certainly separate.
@mmartin Will you submit that as PR/Patch? or would you prefer I do it, and if so - how would you like your 'Suggested-by: <>' tag to appear for credit if I do it...
@kbingham Go ahead and you do it, no need for “Suggested-by” tag.
Aha - the notmuch2 bindings are documented as the notmuch bindings ;-) That's why I couldn't find them. I was looking for something specific as 'notmuch2' but they're now just the expected notmuch python bindings!
https://notmuchmail.org/doc/latest/python-bindings.html
So we have
PR submitted at https://github.com/pazz/alot/pull/1591
Fixed with #1591
Before you submit a bug report, please make sure that the issue still exists on the master branch!
Describe the bug
Attempting to run alot with the latest master branch fails with "AttributeError: 'Thread' object has no attribute 'get_toplevel_messages'" (python trace below).
git bisect brings it to:
de51016548aa8c48726d8d1b1e0e2cd900291780 is the first bad commit alot: Import the
notmuch2
bindingsHowever, the resulting error is actually different at that point and fails with: AttributeError: 'Database' object has no attribute 'create_query'
But I can not run any commit beyond "import the notmuch2" commit.
Software Versions
To Reproduce Steps to reproduce the behaviour:
check out sources at relevant point python3 -m alot
However, some investigations makes it look like this might be specific to a config option I have set:
So perhaps others don't hit this if they don't have that set. (I thought that was the obvious choice to set it to though ... )
Error Log