Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / d7 / d97ec75dae9a0641c0f0c50de4c656f4d9112a
1 Return-Path: <teythoon@jade-hamburg.de>\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 2D481429E54\r
6         for <notmuch@notmuchmail.org>; Sat, 21 Jan 2012 22:01:50 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "Date"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: 0.432\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=0.432 tagged_above=-999 required=5\r
13         tests=[INVALID_DATE=0.432] 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 aV+IMnpwJDlk for <notmuch@notmuchmail.org>;\r
17         Sat, 21 Jan 2012 22:01:49 -0800 (PST)\r
18 Received: from mail.cryptobitch.de (cryptobitch.de [88.198.7.68])\r
19         (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 3D5CD429E40\r
22         for <notmuch@notmuchmail.org>; Sat, 21 Jan 2012 22:01:49 -0800 (PST)\r
23 Received: from mail.jade-hamburg.de (unknown [85.183.11.228])\r
24         (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
25         (No client certificate requested)\r
26         by mail.cryptobitch.de (Postfix) with ESMTPSA id 1A0C85102A5\r
27         for <notmuch@notmuchmail.org>; Sun, 22 Jan 2012 07:01:47 +0100 (CET)\r
28 Received: by mail.jade-hamburg.de (Postfix, from userid 401)\r
29         id 4FD8CDF2A3; Sun, 22 Jan 2012 07:01:46 +0100 (CET)\r
30 Received: from thinkbox.jade-hamburg.de (unknown [10.1.1.109])\r
31         (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
32         (No client certificate requested) (Authenticated sender: teythoon)\r
33         by mail.jade-hamburg.de (Postfix) with ESMTPSA id 6CF39DF2A1\r
34         for <notmuch@notmuchmail.org>; Sun, 22 Jan 2012 07:01:42 +0100 (CET)\r
35 Received: from teythoon by thinkbox.jade-hamburg.de with local (Exim 4.77)\r
36         (envelope-from <teythoon@thinkbox.jade-hamburg.de>)\r
37         id 1RoqUn-0007d5-DL\r
38         for notmuch@notmuchmail.org; Sun, 22 Jan 2012 07:01:41 +0100\r
39 Content-Type: text/plain; charset="utf-8"\r
40 MIME-Version: 1.0\r
41 Content-Transfer-Encoding: quoted-printable\r
42 Date: Sun, 22 Jan 2012 06:01:41 -0000\r
43 To: notmuch mailing list <notmuch@notmuchmail.org>\r
44 Message-ID: <20120122060141.16806.41461@thinkbox.jade-hamburg.de>\r
45 From: Justus Winter <4winter@informatik.uni-hamburg.de>\r
46 Subject: heads up from the python front\r
47 Date: Sun, 22 Jan 2012 07:01:41 +0100\r
48 X-BeenThere: notmuch@notmuchmail.org\r
49 X-Mailman-Version: 2.1.13\r
50 Precedence: list\r
51 List-Id: "Use and development of the notmuch mail system."\r
52         <notmuch.notmuchmail.org>\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
56 List-Post: <mailto:notmuch@notmuchmail.org>\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
60 X-List-Received-Date: Sun, 22 Jan 2012 06:01:50 -0000\r
61 \r
62 Hey everyone :)\r
63 \r
64 after getting to know nmbug a little better (it's actually very nice\r
65 to track bugs and patches this way...) I did some work on the python\r
66 bindings. tl;dr version: housekeeping, python3.2 support, fixed nasty\r
67 bug.\r
68 \r
69 I familiarized myself with nmbug and went through all the threads\r
70 tagged with notmuch::python, added and updated few tags here and there\r
71 and started working on the open issues.\r
72 \r
73 Python 3.2 support\r
74 ------------------\r
75 \r
76 I merged the last patch of a patchset[0] I wrote in december that makes\r
77 it possible to use the python bindings with both python2.x and\r
78 python3.2.\r
79 \r
80 I do not now how complete the port is, most notably the notmuch.py\r
81 script does not work with 3.x. But it is complete enough to make\r
82 afew[1] work using python3.2 and the vanilla notmuch bindings.\r
83 \r
84 If you want to help out and have a small script that uses the bindings\r
85 I'd like to invite you to try to port your script and report any\r
86 issues.\r
87 \r
88 Fix random crashes when using the bindings\r
89 ------------------------------------------\r
90 \r
91 I found a nasty bug I introduced with a patchset[2] that was supposed\r
92 to make the bindings more robust. Annotating pointers returned from\r
93 libnotmuch functions called using ctypes allows the ctypes framework\r
94 to do typechecking. But I accidentally broke the error handling\r
95 code. Citing the commit message:\r
96 \r
97     Before 3434d1940 the return values of libnotmuch functions were\r
98     declared as c_void_p and the code checking for errors compared the\r
99     returned value to None, which is the ctypes equivalent of a NULL\r
100     pointer.\r
101 \r
102     But said commit wrapped all the data types in python classes and the\r
103     semantic changed in a subtle way. If a function returns NULL, the\r
104     wrapped python value is falsish, but no longer equal to None.\r
105 \r
106 In fact the minimal test case triggering the bug is:\r
107 \r
108     import os\r
109     import notmuch\r
110 \r
111     db_path =3D os.path.expanduser('~/Maildir')\r
112 \r
113     db_0 =3D notmuch.Database(db_path, mode=3Dnotmuch.Database.MODE.READ_WR=\r
114 ITE)\r
115     db_1 =3D notmuch.Database(db_path, mode=3Dnotmuch.Database.MODE.READ_WR=\r
116 ITE)\r
117 \r
118 The problem was most apparent when opening the database fails because\r
119 it has been locked by someone else. The patch regarding the function\r
120 Database.open looks like this:\r
121 \r
122          res =3D Database._open(_str(path), mode)\r
123  =\r
124 \r
125 -        if res is None:\r
126 +        if not res:\r
127              raise NotmuchError(message=3D"Could not open the specified dat=\r
128 abase")\r
129          self._db =3D res\r
130 \r
131 The old code fails to notify the callee of the error who causes a\r
132 segfault later if he uses that database reference which is in fact\r
133 NULL.\r
134 \r
135 I feel kind of bad since I severely broke the error handling for all\r
136 pythonic notmuch users out there, is there any chance of a bugfix\r
137 release? The patch[3] is really simple and I'd say it's trivial to\r
138 backport it to the last release. What do you think?\r
139 \r
140 Justus\r
141 \r
142 0: id:1323860305-15802-1-git-send-email-4winter@informatik.uni-hamburg.de\r
143 1: https://github.com/teythoon/afew\r
144 2: id:1318198374-926-1-git-send-email-4winter@informatik.uni-hamburg.de\r
145 3: 8015cbff263606f009b5750d23b28ee332c25db8\r