Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id E7AFB431FD0 for ; Tue, 9 Aug 2011 08:02:53 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.09 X-Spam-Level: X-Spam-Status: No, score=-0.09 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, T_MIME_NO_TEXT=0.01] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bcSwcrMgJkil for ; Tue, 9 Aug 2011 08:02:53 -0700 (PDT) Received: from homiemail-a23.g.dreamhost.com (mailbigip.dreamhost.com [208.97.132.5]) by olra.theworths.org (Postfix) with ESMTP id 4CE4E431FB6 for ; Tue, 9 Aug 2011 08:02:53 -0700 (PDT) Received: from homiemail-a23.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a23.g.dreamhost.com (Postfix) with ESMTP id A460F4B008F; Tue, 9 Aug 2011 08:01:02 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=SSpaeth.de; h=from:to:cc:subject :in-reply-to:references:date:message-id:mime-version: content-type; q=dns; s=sspaeth.de; b=hfW058z5q/LWCdxRl6suRWtnQsb ha8MamNCTFOk1ZscagoX4S9wxr499647X8t8Nxzv+WRM1n619M5H+HGI7uDKt2Id ulSFSRvdVdHSl+86PMwvcR1Cfbn+8BaqH4WZklhei5e1XLRX6twSxXYwZotk5l4L 2fRkHjH1/5b1wDc0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=SSpaeth.de; h=from:to:cc :subject:in-reply-to:references:date:message-id:mime-version: content-type; s=sspaeth.de; bh=WOoVlWP9xyJkg4+qgPxK6lwsDKM=; b=T OBW1xZo1z14R2YAbEpPZ3UPxCDTvyxmWKrwA5VyM0rpKlRanjNrC/PE64O14OajV jVFlP46um/RH2dk00fd9W58SxsaIXzp2U7Tb/WwlbWn+AlQEvJ4x0WC3AJe4o4h5 2xx5RYpeswHBL7VXtbiPjHps6azVyhDUbw0MGwvUcM= Received: from spaetzbook.sspaeth.de (mtec-hg-docking-1-dhcp-21.ethz.ch [129.132.133.21]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: fax@sspaeth.de) by homiemail-a23.g.dreamhost.com (Postfix) with ESMTPSA id 6CF4A4B0086; Tue, 9 Aug 2011 08:01:00 -0700 (PDT) Received: by spaetzbook.sspaeth.de (sSMTP sendmail emulation); Tue, 09 Aug 2011 17:00:58 +0200 From: Sebastian Spaeth To: Patrick Totzke , David Bremner Subject: Re: xapian exceptions not caught in python bindings? In-Reply-To: <20110723133602.GA30241@brick.lan> References: <20110626202733.GA26837@brick> <20110717193538.GA16615@brick.lan> <87r55o65yq.fsf@zancas.localnet> <20110723133602.GA30241@brick.lan> User-Agent: Notmuch/0.5-233-gb404931 (http://notmuchmail.org) Emacs/23.2.1 (x86_64-pc-linux-gnu) Date: Tue, 09 Aug 2011 17:00:58 +0200 Message-ID: <87mxfipr2t.fsf@SSpaeth.de> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Cc: Patrick Totzke , notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 15:02:54 -0000 --=-=-= 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 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk5BS6oACgkQVYX1jMgnoGJSQgCfbZ4qjevLpwl79Ev4Lde1VHu+ kK8An3dmUJ1vLBUcVo8Dj5+BudHoaddP =bEiy -----END PGP SIGNATURE----- --=-=-=--