Re: Crash with Python bindings

Subject: Re: Crash with Python bindings

Date: Fri, 16 Mar 2018 19:30:37 +0100

To: David Bremner, W. Trevor King, Justus Winter


From: Floris Bruynooghe

Hi all,

David Bremner <> writes:

> "W. Trevor King" <> writes:
>> you can avoid the abort (which happens when q.__del__ is called after
>> db.__del__).  We could make that sort of cleanup easier with context
>> managers for Query objects (we have them for databases since [3]), and
>> they look like the only object that keep an internal database
>> reference:
>>   with Database() as db:
>>     with Query(db, "*") as q:
>>       # do something with q
>>     db.close()
> I'm reminded [1] that this problem still exists. If noone has any idea
> of a fix, should we document one of the workarounds?

This is exactly what I have fixed in my alternative bindings which I
created around the end of last year [0].  So we do have an idea of how
to fix this, at the time I said I do believe that it's possible to also
do this for the existing bindings even though it is a lot of work.
After some talking between dkg and me we got to a way forward which
proposed this, but I must admit that after messing a little with getting
a pytest run integrated into the notmuch test-suite instead of using tox
I lost momentum on the project and didn't advance any further.

If someone can hook pytest runs with various python versions into the
notmuch test suit I'd be very much obliged and probably have another go
at this as it's still an interesting problem and gives a nice way


notmuch mailing list