[PATCH] python: fix instantiating NotmuchError

Subject: [PATCH] python: fix instantiating NotmuchError

Date: Mon, 24 Mar 2025 07:59:39 +0100

To: notmuch@notmuchmail.org

Cc:

From: Jakub Wilk


Before:

    >>> notmuch2.Database.default_path('/dev/null')
    Traceback (most recent call last):
    ...
    KeyError: 'No database.path setting in /dev/null'

After:

    >>> notmuch2.Database.default_path('/dev/null')
    Traceback (most recent call last):
    ...
    notmuch2.NotmuchError: No database.path setting in /dev/null
---
 bindings/python-cffi/notmuch2/_database.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bindings/python-cffi/notmuch2/_database.py b/bindings/python-cffi/notmuch2/_database.py
index d7485b4d..6a2b4ca1 100644
--- a/bindings/python-cffi/notmuch2/_database.py
+++ b/bindings/python-cffi/notmuch2/_database.py
@@ -245,7 +245,7 @@ class Database(base.NotmuchObject):
         try:
             return pathlib.Path(parser.get('database', 'path'))
         except configparser.Error:
-            raise errors.NotmuchError(
+            raise errors.NotmuchError(None,
                 'No database.path setting in {}'.format(cfg_path))
 
     def __del__(self):
-- 
2.39.5

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

Thread: