notmuch_query_add_tag_exclude bug

Justus Winter justus at sequoia-pgp.org
Sun Mar 4 02:26:22 PST 2018


Hi :)

so I found a weird bug with notmuch_query_add_tag_exclude.  Apparently,
when I exclude 'spam', and search for 'spam', I still get results, but
if I exclude 'spam', and search for 'is_a_spam', I get no results, even
though there are mails tagged with that tag.

~~~ snip ~~~
import notmuch

d = notmuch.Database()
q = d.create_query("tag:spam")
q.exclude_tag("spam")
assert len(list(q.search_messages())) > 0

q = d.create_query("tag:is_a_spam")
assert len(list(q.search_messages())) > 0

q = d.create_query("tag:is_a_spam")
q.exclude_tag("spam")
assert len(list(q.search_messages())) > 0, "weird"
~~~ snip ~~~

% python3 ignore_tag_bug.py
Traceback (most recent call last):
  File "ignore_tag_bug.py", line 13, in <module>
    assert len(list(q.search_messages())) > 0, "weird"
AssertionError: weird
% notmuch --version
notmuch 0.26

Cheers,
Justus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20180304/fd1a7558/attachment.sig>


More information about the notmuch mailing list