Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / e6 / eb60b53ee37a487c73b6345ed8154ef4bb1586
1 Return-Path: <patricktotzke@googlemail.com>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id CA912431FD0\r
6         for <notmuch@notmuchmail.org>; Sun, 17 Jul 2011 12:35:48 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id cqH2DmLFtvSw for <notmuch@notmuchmail.org>;\r
17         Sun, 17 Jul 2011 12:35:48 -0700 (PDT)\r
18 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
19  [74.125.82.45])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
20  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
21  D5EC9431FB6    for <notmuch@notmuchmail.org>; Sun, 17 Jul 2011 12:35:47 -0700\r
22  (PDT)\r
23 Received: by wwj40 with SMTP id 40so2111183wwj.2\r
24         for <notmuch@notmuchmail.org>; Sun, 17 Jul 2011 12:35:46 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
26         d=googlemail.com; s=gamma;\r
27         h=date:from:to:subject:message-id:references:mime-version\r
28         :content-type:content-disposition:in-reply-to:x-offlineimap\r
29         :user-agent; bh=AedytK2wwXJOO8BwhqxK5gW8LshabjUwTv5Vjh7zTFg=;\r
30         b=mCxKAyD/jeiiBw+j99NrCm1I8PXHanpIjz8dtjvTV0Na3PUh2WhvetJBYD6P9ECqF9\r
31         CZfJfTmgZHd0dWCrPFELyTW4aASuYVkyLU0fEPB7fWXU8gLaPTcFCDt+7i9sl71K37qt\r
32         onDJ5rmdqBPWo/i8h2EnuS0Z04pAzfmAFYVEY=\r
33 Received: by 10.227.28.212 with SMTP id n20mr4800710wbc.82.1310931346454;\r
34         Sun, 17 Jul 2011 12:35:46 -0700 (PDT)\r
35 Received: from brick.lan (cpc1-sgyl2-0-0-cust47.sgyl.cable.virginmedia.com\r
36         [80.192.18.48])\r
37         by mx.google.com with ESMTPS id fe4sm2837975wbb.62.2011.07.17.12.35.42\r
38         (version=TLSv1/SSLv3 cipher=OTHER);\r
39         Sun, 17 Jul 2011 12:35:44 -0700 (PDT)\r
40 Date: Sun, 17 Jul 2011 20:35:38 +0100\r
41 From: Patrick Totzke <patricktotzke@googlemail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: Re: xapian exceptions not caught in python bindings?\r
44 Message-ID: <20110717193538.GA16615@brick.lan>\r
45 References: <20110626202733.GA26837@brick>\r
46 MIME-Version: 1.0\r
47 Content-Type: multipart/signed; micalg=pgp-sha1;\r
48         protocol="application/pgp-signature"; boundary="r5Pyd7+fXNt84Ff3"\r
49 Content-Disposition: inline\r
50 In-Reply-To: <20110626202733.GA26837@brick>\r
51 X-OfflineIMAP: 2521481603-8359016323\r
52 User-Agent: Mutt/1.5.21 (2010-09-15)\r
53 X-BeenThere: notmuch@notmuchmail.org\r
54 X-Mailman-Version: 2.1.13\r
55 Precedence: list\r
56 List-Id: "Use and development of the notmuch mail system."\r
57         <notmuch.notmuchmail.org>\r
58 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
60 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
61 List-Post: <mailto:notmuch@notmuchmail.org>\r
62 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
63 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
65 X-List-Received-Date: Sun, 17 Jul 2011 19:35:48 -0000\r
66 \r
67 \r
68 --r5Pyd7+fXNt84Ff3\r
69 Content-Type: text/plain; charset=us-ascii\r
70 Content-Disposition: inline\r
71 Content-Transfer-Encoding: quoted-printable\r
72 \r
73 Hi all,\r
74 \r
75 I know this issue is not easy to fix and that it's partly a problem\r
76 with xapians bad error handling. I just want to state another problem we run\r
77 into with xapians exceptions in combination with the python bindings.\r
78 If you run the following snippet, you notice that not only do we get\r
79 xapian-garbage on stderr but we don't really get any exceptions at the\r
80 position where it would make sense:\r
81 \r
82 --------------------------------\r
83 =66rom notmuch import Database\r
84 bad_querystring =3D "test AND"\r
85 \r
86 # This should raise a NotmuchError and query should be NoneType\r
87 query =3D Database().create_query(bad_querystring)\r
88 \r
89 # this prints to stderr but returns a Threads object.\r
90 threads =3D query.search_threads()\r
91 \r
92 # this finally raises a NotmuchError(STATUS.NOT_INITIALIZED)\r
93 for t in threads: print t\r
94 --------------------------------\r
95 \r
96 Although the querystring is invalid syntactically, the query object gets=20\r
97 instantiated and can of course not behave as it should later on.\r
98 =46rom a user point of view it is really quite strange that only later\r
99 (if one iterates over threads) an exception is raised.\r
100 \r
101 One solution that comes to mind here is simply bending sys.sdterr to someth=\r
102 ing internal,\r
103 interpreting its output and raising the correct exceptions accordingly.\r
104 The downside is, this would have to happen every time the library gets call=\r
105 ed.\r
106 Also, a fix like this would be python specific, so everybody else would sti=\r
107 ll get\r
108 garbage printed to stderr occasionally.\r
109 \r
110 Thoughts anyone?\r
111 /p\r
112 \r
113 \r
114 \r
115 On Sun, Jun 26, 2011 at 09:27:33PM +0100, Patrick Totzke wrote:\r
116 > Hi all!\r
117 > It's me again, with some strange python behaviour :/\r
118 >=20\r
119 > When I iterate over threads or messages only partially,\r
120 > then make changes to the index and continue the iteration,\r
121 > then I don't necessarily get NotmuchError's but the underlying\r
122 > libnotmuch seems to call terminate. I get the following two lines on\r
123 > stderr:\r
124 >   terminate called after throwing an instance of 'Xapian::DatabaseModifie=\r
125 dError'\r
126 >   Aborted\r
127 > then python aborts without an exception.\r
128 > This happens on current master with current python bindings. To reproduce\r
129 > use this to iterate over messages:\r
130 >=20\r
131 > ------------------%<-------------------\r
132 > #it_read.py\r
133 > from notmuch import Query,Database\r
134 > msgs =3D Database().create_query('*').search_messages()\r
135 >=20\r
136 > i=3D0\r
137 > for m in msgs:\r
138 >     i=3Di+1\r
139 >     if i%50=3D=3D0:\r
140 >         raw_input()\r
141 >     readit =3D str(m)\r
142 > ------------------>%-------------------\r
143 >=20\r
144 > start it, then use this to change the index:\r
145 >=20\r
146 > ------------------%<-------------------\r
147 > #it_write.py=20\r
148 > from notmuch import Query,Database\r
149 > db =3D Database(mode =3D Database.MODE.READ_WRITE)\r
150 > msgs =3D Query(db,'*').search_messages()\r
151 >=20\r
152 > i=3D0\r
153 > for m in msgs:\r
154 >     i=3Di+1\r
155 >     if i%20=3D=3D0:\r
156 >         m.add_tag('REMOVEME')\r
157 > ------------------>%-------------------\r
158 >=20\r
159 > you have to alternate a bit between hitting enter in the\r
160 > read code and rerunning the write code.\r
161 > Read will fail at some point.\r
162 >=20\r
163 > The strange thing is that its not consistent:\r
164 > I stumbled upon this while reading a list of threads from notmuch.threads=\r
165  on\r
166 > demand. If reading from the iterator catches a NotmuchError, i create a n=\r
167 ew one\r
168 > and update my list threads read so far. This does work, but: on every\r
169 > NotmuchError, I get this on stderr:\r
170 >  A Xapian exception occurred performing query: The revision being read ha=\r
171 s been discarded - you should call Xapian::Database::reopen() and retry the=\r
172  operation\r
173 >  Query string was: thread:0000000000001876\r
174 >=20\r
175 > After a couple of resets this does not happen again but the next time i r=\r
176 ead\r
177 > from an outdated index, the whole UI terminates with the "Aborted" message\r
178 > stated above.\r
179 >=20\r
180 > To sum up, I think there are two bad things happening here:\r
181 > 1) should libnotmuch really print to stderr?\r
182 > 2) the python bindings are either not relaying all exceptions or libnotmu=\r
183 ch is not relaying=20\r
184 > all xapian exceptions in order for the bindings to intercept them\r
185 >=20\r
186 > cheers,\r
187 > /p\r
188 \r
189 \r
190 \r
191 --r5Pyd7+fXNt84Ff3\r
192 Content-Type: application/pgp-signature; name="signature.asc"\r
193 Content-Description: Digital signature\r
194 \r
195 -----BEGIN PGP SIGNATURE-----\r
196 Version: GnuPG v1.4.11 (GNU/Linux)\r
197 \r
198 iEYEARECAAYFAk4jOYoACgkQlDQDZ9fWxaqAqACg0YgDBWosSX5bPFp0uRBJ17nY\r
199 EBYAnjfDYSXsGqpDpTi5xghHi4REcyKz\r
200 =0rOH\r
201 -----END PGP SIGNATURE-----\r
202 \r
203 --r5Pyd7+fXNt84Ff3--\r