[PATCH 2/2] Make messages returned by Thread objects owned

2020-06-15 Thread Floris Bruynooghe
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. ---

python: Continuing message re-use fix

2020-06-15 Thread Floris Bruynooghe
Hi, This builds on the patch by Anton Khirnov to fix the message re-use that is possible when accessing messages from a thread. I started with just addressing my own comments on this patch, but evolved it into switching the logic around and leave the normal Message object untouched. Instead I

[PATCH 1/2] python/notmuch2: add bindings for the database config strings

2020-06-15 Thread Floris Bruynooghe
From: Anton Khirnov --- bindings/python-cffi/notmuch2/_build.py| 17 + bindings/python-cffi/notmuch2/_config.py | 84 ++ bindings/python-cffi/notmuch2/_database.py | 23 ++ 3 files changed, 124 insertions(+) create mode 100644

[PATCH 2/2] python config access: fix style and KeyError bug

2020-06-15 Thread Floris Bruynooghe
This fixes some minor style/pep8 things and adds tests for the new config support. Also fixes a bug where KeyError was never raised on a missing key. --- bindings/python-cffi/notmuch2/_config.py | 9 ++-- bindings/python-cffi/tests/test_config.py | 56 +++ 2 files changed,

python: config API

2020-06-15 Thread Floris Bruynooghe
This is a followup on the patch from Anton Khirnov adding config API support to the python bindings. I can not help myself but point out that I did not spot the bug until not only I had written tests, but until I looked at the test coverage to see what was not yet executed and added more tests.

Re: [PATCH] Update tox.ini for python3.8 and fix pypy3.6

2020-06-15 Thread Floris Bruynooghe
On Mon 15 Jun 2020 at 07:06 -0300, David Bremner wrote: > Floris Bruynooghe writes: > >> [testenv] >> deps = >> @@ -14,3 +14,6 @@ commands = pytest --cov={envsitepackagesdir}/notmuch2 >> {posargs} >> >> [testenv:pypy35] >> basepython = pypy3.5 >> + >> +[testenv:pypy36] >> +basepython =

[PATCH 1/2] python/notmuch2: do not destroy messages owned by a query

2020-06-15 Thread Floris Bruynooghe
From: Anton Khirnov 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.

Re: difficulties with notmuch2 python bindings for alot

2020-06-15 Thread Floris Bruynooghe
On Sun 14 Jun 2020 at 19:44 -0300, David Bremner wrote: > Floris Bruynooghe writes: > >> One thing that they encountered and don't yet understand is that they >> reported issues with leaking filedescriptors. They used the bindings in >> a way where I expect it to only call

Re: [PATCH] Support aborting the atomic context

2020-06-15 Thread Floris Bruynooghe
On Mon 15 Jun 2020 at 07:35 -0300, David Bremner wrote: > Floris Bruynooghe writes: > >> This is an implementation of what was suggested in >> id:87v9k96xtl@powell.devork.be It closes the database as that is >> the only safe way to do this afaik. >> >> Currently when the database is closed

Re: python: config API

2020-06-15 Thread David Bremner
Floris Bruynooghe writes: > This is a followup on the patch from Anton Khirnov adding config > API support to the python bindings. > > I can not help myself but point out that I did not spot the bug > until not only I had written tests, but until I looked at the > test coverage to see what was

Re: [PATCH] Support aborting the atomic context

2020-06-15 Thread David Bremner
Floris Bruynooghe writes: > This is an implementation of what was suggested in > id:87v9k96xtl@powell.devork.be It closes the database as that is > the only safe way to do this afaik. > > Currently when the database is closed there are still a bunch of > operations which can result in

Re: [PATCH] Update tox.ini for python3.8 and fix pypy3.6

2020-06-15 Thread David Bremner
Floris Bruynooghe writes: > [testenv] > deps = > @@ -14,3 +14,6 @@ commands = pytest --cov={envsitepackagesdir}/notmuch2 > {posargs} > > [testenv:pypy35] > basepython = pypy3.5 > + > +[testenv:pypy36] > +basepython = pypy3.6 I'm not an expert, but should python 3.7 and python 3.8 have

Re: [PATCH] Update tox.ini for python3.8 and fix pypy3.6

2020-06-15 Thread Tomi Ollila
On Mon, Jun 15 2020, David Bremner wrote: > Floris Bruynooghe writes: > >> [testenv] >> deps = >> @@ -14,3 +14,6 @@ commands = pytest --cov={envsitepackagesdir}/notmuch2 >> {posargs} >> >> [testenv:pypy35] >> basepython = pypy3.5 >> + >> +[testenv:pypy36] >> +basepython = pypy3.6 > > I'm

Re: [PATCH] Update tox.ini for python3.8 and fix pypy3.6

2020-06-15 Thread David Bremner
Tomi Ollila writes: > On Mon, Jun 15 2020, David Bremner wrote: > >> Floris Bruynooghe writes: >> >>> [testenv] >>> deps = >>> @@ -14,3 +14,6 @@ commands = pytest --cov={envsitepackagesdir}/notmuch2 >>> {posargs} >>> >>> [testenv:pypy35] >>> basepython = pypy3.5 >>> + >>>

Re: [PATCH] Update tox.ini for python3.8 and fix pypy3.6

2020-06-15 Thread David Bremner
Floris Bruynooghe writes: > Python 3.8 has been released for a while now, make sure we keep > supporting it correctly. > > PyPy 3.6 wasn not configured correctly. merged to origin and master d ___ notmuch mailing list notmuch@notmuchmail.org

Re: [PATCH] Add missing set methods to tagsets

2020-06-15 Thread David Bremner
Floris Bruynooghe writes: > Even though we use collections.abc.Set which implements all these > methods under their operator names, the actual named variations of > these methods are shockingly missing. So let's add them manually. merged to release and master. d