notmuch_query_add_tag_exclude bug

Subject: notmuch_query_add_tag_exclude bug

Date: Sun, 04 Mar 2018 11:26:22 +0100

To: notmuch@notmuchmail.org

Cc:

From: Justus Winter


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
signature.asc (application/pgp-signature)
_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: