Re: [PATCH 1/2] cli: S/MIME verification/decryption support
[notmuch-archives.git] / e8 / b4dde7b1b83dc9fd69d4bc595cc2a0b5d42da3
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 D7078429E29\r
6         for <notmuch@notmuchmail.org>; Sun, 26 Jun 2011 13:27:40 -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 AsuzmZ2LkTR4 for <notmuch@notmuchmail.org>;\r
17         Sun, 26 Jun 2011 13:27:40 -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  02E43431FD0    for <notmuch@notmuchmail.org>; Sun, 26 Jun 2011 13:27:39 -0700\r
22  (PDT)\r
23 Received: by wwj40 with SMTP id 40so3347665wwj.2\r
24         for <notmuch@notmuchmail.org>; Sun, 26 Jun 2011 13:27:38 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
26         d=googlemail.com; s=gamma;\r
27         h=domainkey-signature:date:from:to:subject:message-id:mime-version\r
28         :content-type:content-disposition:user-agent;\r
29         bh=TuIxnP7OhrCKWGVETIHy8Ml2Nn52KQWYnTeVY+eZhwI=;\r
30         b=FtZNJH3ajVEosYlvRAItnxtPwXtNI6CyGQkjRS8nmVGBvu2qFkHxddOJWqj2ZyZVsx\r
31         1ijOhFv0sa6XliDwA/1XRQdg4Ijf8GwQ/4JopR97qwL1pZuksvbDJYHHgODZHfQMilb6\r
32         Sp+iNOEH1486MUSs/t7FNUeBxpPJW+LSISj8Y=\r
33 DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma;\r
34         h=date:from:to:subject:message-id:mime-version:content-type\r
35         :content-disposition:user-agent;\r
36         b=lQOhlZWQT99ANPLta8NMr8AJjYVWhXjlUdtRtWfJYAwHg7Nk+bADkHSuoSd4UBVcfu\r
37         1BCQw5JNSkzQN+BokNPFSQRBiuSJnZbOPS1lGgMGthp6N1qN3VrN5VIFxx4bo4JT461n\r
38         QNKcZHxR/ZHVJl+Mmh9WzfntxG2OlB4HcMsJg=\r
39 Received: by 10.216.229.202 with SMTP id h52mr1116764weq.17.1309120058628;\r
40         Sun, 26 Jun 2011 13:27:38 -0700 (PDT)\r
41 Received: from brick (cpc1-sgyl2-0-0-cust47.sgyl.cable.virginmedia.com\r
42         [80.192.18.48])\r
43         by mx.google.com with ESMTPS id w58sm2437878weq.1.2011.06.26.13.27.36\r
44         (version=TLSv1/SSLv3 cipher=OTHER);\r
45         Sun, 26 Jun 2011 13:27:37 -0700 (PDT)\r
46 Date: Sun, 26 Jun 2011 21:27:33 +0100\r
47 From: Patrick Totzke <patricktotzke@googlemail.com>\r
48 To: notmuch@notmuchmail.org\r
49 Subject: xapian exceptions not caught in python bindings?\r
50 Message-ID: <20110626202733.GA26837@brick>\r
51 MIME-Version: 1.0\r
52 Content-Type: multipart/signed; micalg=pgp-sha1;\r
53         protocol="application/pgp-signature"; boundary="J2SCkAp4GZ/dPZZf"\r
54 Content-Disposition: inline\r
55 User-Agent: Mutt/1.5.21 (2010-09-15)\r
56 X-BeenThere: notmuch@notmuchmail.org\r
57 X-Mailman-Version: 2.1.13\r
58 Precedence: list\r
59 List-Id: "Use and development of the notmuch mail system."\r
60         <notmuch.notmuchmail.org>\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
64 List-Post: <mailto:notmuch@notmuchmail.org>\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
67         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
68 X-List-Received-Date: Sun, 26 Jun 2011 20:27:41 -0000\r
69 \r
70 \r
71 --J2SCkAp4GZ/dPZZf\r
72 Content-Type: text/plain; charset=us-ascii\r
73 Content-Disposition: inline\r
74 Content-Transfer-Encoding: quoted-printable\r
75 \r
76 Hi all!\r
77 It's me again, with some strange python behaviour :/\r
78 \r
79 When I iterate over threads or messages only partially,\r
80 then make changes to the index and continue the iteration,\r
81 then I don't necessarily get NotmuchError's but the underlying\r
82 libnotmuch seems to call terminate. I get the following two lines on\r
83 stderr:\r
84   terminate called after throwing an instance of 'Xapian::DatabaseModifiedE=\r
85 rror'\r
86   Aborted\r
87 then python aborts without an exception.\r
88 This happens on current master with current python bindings. To reproduce\r
89 use this to iterate over messages:\r
90 \r
91 ------------------%<-------------------\r
92 #it_read.py\r
93 =66rom notmuch import Query,Database\r
94 msgs =3D Database().create_query('*').search_messages()\r
95 \r
96 i=3D0\r
97 for m in msgs:\r
98     i=3Di+1\r
99     if i%50=3D=3D0:\r
100         raw_input()\r
101     readit =3D str(m)\r
102 ------------------>%-------------------\r
103 \r
104 start it, then use this to change the index:\r
105 \r
106 ------------------%<-------------------\r
107 #it_write.py=20\r
108 =66rom notmuch import Query,Database\r
109 db =3D Database(mode =3D Database.MODE.READ_WRITE)\r
110 msgs =3D Query(db,'*').search_messages()\r
111 \r
112 i=3D0\r
113 for m in msgs:\r
114     i=3Di+1\r
115     if i%20=3D=3D0:\r
116         m.add_tag('REMOVEME')\r
117 ------------------>%-------------------\r
118 \r
119 you have to alternate a bit between hitting enter in the\r
120 read code and rerunning the write code.\r
121 Read will fail at some point.\r
122 \r
123 The strange thing is that its not consistent:\r
124 I stumbled upon this while reading a list of threads from notmuch.threads on\r
125 demand. If reading from the iterator catches a NotmuchError, i create a new=\r
126  one\r
127 and update my list threads read so far. This does work, but: on every\r
128 NotmuchError, I get this on stderr:\r
129  A Xapian exception occurred performing query: The revision being read has =\r
130 been discarded - you should call Xapian::Database::reopen() and retry the o=\r
131 peration\r
132  Query string was: thread:0000000000001876\r
133 \r
134 After a couple of resets this does not happen again but the next time i read\r
135 =66rom an outdated index, the whole UI terminates with the "Aborted" message\r
136 stated above.\r
137 \r
138 To sum up, I think there are two bad things happening here:\r
139 1) should libnotmuch really print to stderr?\r
140 2) the python bindings are either not relaying all exceptions or libnotmuch=\r
141  is not relaying=20\r
142 all xapian exceptions in order for the bindings to intercept them\r
143 \r
144 cheers,\r
145 /p\r
146 \r
147 --J2SCkAp4GZ/dPZZf\r
148 Content-Type: application/pgp-signature; name="signature.asc"\r
149 Content-Description: Digital signature\r
150 \r
151 -----BEGIN PGP SIGNATURE-----\r
152 Version: GnuPG v1.4.11 (GNU/Linux)\r
153 \r
154 iEYEARECAAYFAk4HljUACgkQlDQDZ9fWxaofPQCgtmDfXZrDJv9ZIaUL6XSfrtVZ\r
155 s08An3rOlZhZWclne70YhAnCl0X4A3J+\r
156 =bV3f\r
157 -----END PGP SIGNATURE-----\r
158 \r
159 --J2SCkAp4GZ/dPZZf--\r