<feed xmlns='http://www.w3.org/2005/Atom'>
<title>notmuch/bindings/python-cffi/notmuch2/_message.py, branch 0.38.1</title>
<subtitle>thread-based email index, search, and tagging</subtitle>
<id>https://git.notmuchmail.org/git/notmuch/atom?h=0.38.1</id>
<link rel='self' href='https://git.notmuchmail.org/git/notmuch/atom?h=0.38.1'/>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/'/>
<updated>2022-07-05T10:34:25Z</updated>
<entry>
<title>bindings/python-cffi: fix docstring</title>
<updated>2022-07-05T10:34:25Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2022-07-03T20:26:46Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=db44af75ad5a79b3fd5ecad93fe95195ef175ebd'/>
<id>urn:sha1:db44af75ad5a79b3fd5ecad93fe95195ef175ebd</id>
<content type='text'>
the method Database.get_message does exist any more (if it ever
did). This makes the docstring unhelpful as an example.
</content>
</entry>
<entry>
<title>Merge branch 'release'</title>
<updated>2022-01-09T13:20:56Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2022-01-09T13:20:56Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=22e04ed01acc115b7fb25b60231014f585f11c4a'/>
<id>urn:sha1:22e04ed01acc115b7fb25b60231014f585f11c4a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>python-cffi: returned OwnedMessage objects from Message.replies</title>
<updated>2022-01-08T20:29:41Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2022-01-08T14:03:16Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=9e7ea628e6bddbd7345d053a3daf14af74896cc2'/>
<id>urn:sha1:9e7ea628e6bddbd7345d053a3daf14af74896cc2</id>
<content type='text'>
If we return regular Message objects, python will try to destroy them,
and the underlying notmuch object, causing e.g. the crash [1].

[1]: id:87sfu6utxg.fsf@tethera.net
</content>
</entry>
<entry>
<title>bindings/python-cffi: add matched property to message objects</title>
<updated>2022-01-01T15:48:40Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2022-01-01T14:36:43Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=9cc026f3daaa7731527787f8c7e729c0a08c456c'/>
<id>urn:sha1:9cc026f3daaa7731527787f8c7e729c0a08c456c</id>
<content type='text'>
Existing users of the legacy python bindings use
message.get_flags(Message.FLAG.MATCH) to determine which messages in a
thread matched. Since the bindings don't provide get_flags anymore,
they should provide a property analogous to the existing "excluded"
property.
</content>
</entry>
<entry>
<title>Fix typos</title>
<updated>2020-08-10T00:14:36Z</updated>
<author>
<name>Jonas Bernoulli</name>
<email>jonas@bernoul.li</email>
</author>
<published>2020-08-08T11:49:55Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=6c84dee53193a78cf797b44d3febcc14488ea6b1'/>
<id>urn:sha1:6c84dee53193a78cf797b44d3febcc14488ea6b1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Make messages returned by Thread objects owned</title>
<updated>2020-06-16T11:02:02Z</updated>
<author>
<name>Floris Bruynooghe</name>
<email>flub@devork.be</email>
</author>
<published>2020-06-15T20:58:50Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=2d895a0119b423b117d10e890c9e0eb5d2a9cdf8'/>
<id>urn:sha1:2d895a0119b423b117d10e890c9e0eb5d2a9cdf8</id>
<content type='text'>
This reverses the logic of StandaloneMessage to instead create a
OwnedMessage.  Only the Thread class allows retrieving messages more
then once so it can explicitly create such messages.

The added test fails with SIGABRT without the fix for the message
re-use in threads being present.
</content>
</entry>
<entry>
<title>python/notmuch2: do not destroy messages owned by a query</title>
<updated>2020-06-16T11:02:02Z</updated>
<author>
<name>Anton Khirnov</name>
<email>anton@khirnov.net</email>
</author>
<published>2020-06-15T20:58:49Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=131757907907380213b32934d9e73cec942ace43'/>
<id>urn:sha1:131757907907380213b32934d9e73cec942ace43</id>
<content type='text'>
Any messages retrieved from a query - either directly via
search_messages() or indirectly via thread objects - are owned by that
query. Retrieving the same message (i.e. corresponding to the same
message ID / database object) several times will always yield the same
C object.

The caller is allowed to destroy message objects owned by a query before
the query itself - which can save memory for long-lived queries.
However, that message must then never be retrieved again from that
query.

The python-notmuch2 bindings will currently destroy every message object
in Message._destroy(), which will lead to an invalid free if the same
message is then retrieved again. E.g. the following python program leads
to libtalloc abort()ing:

import notmuch2
db   = notmuch2.Database(mode = notmuch2.Database.MODE.READ_ONLY)
t    = next(db.threads('*'))
msgs = list(zip(t.toplevel(), t.toplevel()))
msgs = list(zip(t.toplevel(), t.toplevel()))

Fix this issue by creating a subclass of Message, which is used for
"standalone" message which have to be freed by the caller. Message class
is then used only for messages descended from a query, which do not need
to be freed by the caller.
</content>
</entry>
<entry>
<title>python/notmuch2: fix typo for "destroyed"</title>
<updated>2019-12-23T22:13:09Z</updated>
<author>
<name>Daniel Kahn Gillmor</name>
<email>dkg@fifthhorseman.net</email>
</author>
<published>2019-12-23T21:06:48Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=93cc4b99dff2dea1f4af3b39f1864eb976c37648'/>
<id>urn:sha1:93cc4b99dff2dea1f4af3b39f1864eb976c37648</id>
<content type='text'>
Another fix to the docstrings, this time for the English part of the
docstrings, not the Python class name.  No functional changes here.

Signed-off-by: Daniel Kahn Gillmor &lt;dkg@fifthhorseman.net&gt;
</content>
</entry>
<entry>
<title>Rename package to notmuch2</title>
<updated>2019-12-03T12:12:30Z</updated>
<author>
<name>Floris Bruynooghe</name>
<email>flub@devork.be</email>
</author>
<published>2019-11-17T16:41:35Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=e2df30f7a98f91543d0b3561dbb366eb4b3d812c'/>
<id>urn:sha1:e2df30f7a98f91543d0b3561dbb366eb4b3d812c</id>
<content type='text'>
This is based on a previous discussion on the list where this was more
or less seen as the least-bad option.
</content>
</entry>
</feed>
