xapian exceptions not caught in python bindings?

Sebastian Spaeth Sebastian at SSpaeth.de
Tue Aug 9 08:00:58 PDT 2011


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20110809/725228a6/attachment.pgp>


More information about the notmuch mailing list