Re: [PATCH v3] bindings/python-cffi: allow reopening a database

Subject: Re: [PATCH v3] bindings/python-cffi: allow reopening a database

Date: Sat, 13 Sep 2025 09:14:09 -0300

To: Anton Khirnov

Cc: notmuch@notmuchmail.org

From: David Bremner


Anton Khirnov <anton@khirnov.net> writes:

> This will be useful for handling NOTMUCH_STATUS_OPERATION_INVALIDATED
> errors that will be exposed through the bindings in a following commit.
> ---

Would it be hard to add a test for this new binding (on the python
side)? Naively even just reopening a read only database as read-write
could be a sanity check.

>  
> +    def reopen(self, mode=None):
> +        """Reopen an opened notmuch database.
> +
> +        :param mode: Mode to reopen the database with. When None, the previously
> +           active mode is preserved.
> +        :type mode: :attr:`MODE`, str, or None.
> +
> +        This is primarily useful to recover from OperationInvalidatedError.
> +        """

it is probably worth mentioning the case of re-opening a database for
read-write, as that how the CLI currently uses this function.

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: