Re: xapian exceptions not caught in python bindings?

Subject: Re: xapian exceptions not caught in python bindings?

Date: Tue, 09 Aug 2011 17:00:58 +0200

To: Patrick Totzke, David Bremner

Cc: Patrick Totzke, notmuch@notmuchmail.org

From: Sebastian Spaeth


On Sat, 23 Jul 2011 14:36:02 +0100, Patrick Totzke wrote:
> I hope the patch I send is correctly formated, I'm still fumbling with
> git send-email and the --in-reply-to option.
> Anyhow, forgive my language, of course I didn't mean to be condescending in any
> way by calling these prints garbage! It's just that it's highly unusual and very
> 'non-pythonic' that a module directly prints to stderr instead of raising exceptions
> and if you work directly with a curseslike interface on a terminal these
> errormessages litter my screen.

Hi,
1) I fixed the lack of throwing a NotmuchError when search_threads()
failed. This was a bug.

2) Taking over stderr and capturing it in a temporary file whenever we
create a query sounds incredibly hackish to me. It also potentially has
side-effects that I cannot even judge (we might be using stderr for
something completely different).

IMHO, libnotmuch should be modified to not directly print to stderr
but to provide a string with a detailed error message together with it's
status value. This would be the proper way to deal with it, even if it
means a bit more complexity in the notmuch binary.

Sebastian
part-000.sig (application/pgp-signature)

Thread: