Re: [PATCH v3] nmbug: Translate to Python
[notmuch-archives.git] / 6e / 0f37ce002745875cd68aeecd82e7911b4092fa
1 Return-Path: <schnouki@schnouki.net>\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 F4224431FAF\r
6         for <notmuch@notmuchmail.org>; Fri, 20 Jan 2012 04:34:03 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.1\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1]\r
13         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 LCyTPvkVEkTQ for <notmuch@notmuchmail.org>;\r
17         Fri, 20 Jan 2012 04:34:03 -0800 (PST)\r
18 Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222])\r
19         by olra.theworths.org (Postfix) with ESMTP id 340F8431FAE\r
20         for <notmuch@notmuchmail.org>; Fri, 20 Jan 2012 04:34:03 -0800 (PST)\r
21 Received: from thor.loria.fr (thor.loria.fr [152.81.12.250])\r
22         by ks3536.kimsufi.com (Postfix) with ESMTPSA id 30B526C000A;\r
23         Fri, 20 Jan 2012 13:33:49 +0100 (CET)\r
24 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net;\r
25         s=key-schnouki; t=1327062829;\r
26         bh=PXpy8heLvAnTN2W3ypGlelWwgEK3cZQ5Wae3zRvu3BU=;\r
27         h=From:To:Subject:In-Reply-To:References:Date:Message-ID:\r
28         MIME-Version:Content-Type;\r
29         b=GrlqquWnFblyiQdMRskEYGu/F8rGkh2nzS5ICFp/cki7cUnYqYO5rcmRZjEIEBOBA\r
30         q+cTWTbMFU9pBSDbM+0xBJXlFX8e8A0mH0SVA9hz9Gugl54VMEr+EZYacG/sTfmgeF\r
31         sp6TDVNsrBg54eNtKbCnIp7AqViyDwUKdX+sDCr0=\r
32 From: Thomas Jost <schnouki@schnouki.net>\r
33 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
34 Subject: Re: [PATCH v4 1/3] show: don't use hex literals in JSON output\r
35 In-Reply-To: <87mx9id1wo.fsf@zancas.localnet>\r
36 References: <87fwfaemuc.fsf@thor.loria.fr>\r
37         <1327052365-20012-1-git-send-email-schnouki@schnouki.net>\r
38         <87mx9id1wo.fsf@zancas.localnet>\r
39 User-Agent: Notmuch/0.11+96~g5e187d3 (http://notmuchmail.org) Emacs/24.0.92.1\r
40         (x86_64-unknown-linux-gnu)\r
41 Date: Fri, 20 Jan 2012 13:33:58 +0100\r
42 Message-ID: <87d3aeeeo9.fsf@thor.loria.fr>\r
43 MIME-Version: 1.0\r
44 Content-Type: multipart/signed; boundary="=-=-=";\r
45         micalg=pgp-sha1; protocol="application/pgp-signature"\r
46 X-BeenThere: notmuch@notmuchmail.org\r
47 X-Mailman-Version: 2.1.13\r
48 Precedence: list\r
49 List-Id: "Use and development of the notmuch mail system."\r
50         <notmuch.notmuchmail.org>\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
54 List-Post: <mailto:notmuch@notmuchmail.org>\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
58 X-List-Received-Date: Fri, 20 Jan 2012 12:34:04 -0000\r
59 \r
60 --=-=-=\r
61 Content-Type: text/plain\r
62 Content-Transfer-Encoding: quoted-printable\r
63 \r
64 On Fri, 20 Jan 2012 07:55:03 -0400, David Bremner <david@tethera.net> wrote:\r
65 > On Fri, 20 Jan 2012 10:39:23 +0100, Thomas Jost <schnouki@schnouki.net> w=\r
66 rote:\r
67 > > JSON does not support hex literals (0x..) so numbers must be formatted =\r
68 as %d\r
69 > > instead of %x.\r
70 > > ---\r
71 > >  notmuch-show.c |    2 +-\r
72 > >  1 files changed, 1 insertions(+), 1 deletions(-)\r
73 >=20=20\r
74 > Probably I'm just being lazy here, but can you explain why this change\r
75 > does not require a corresponding change on the emacs side?\r
76 \r
77 Because Emacs already does the right thing. JSON numbers are supposed to\r
78 be decimal only (see http://json.org/: digits are 0-9 only), but the\r
79 current code could result in displaying a hexadecimal number instead\r
80 ("c" instead of "12"). This would then trigger an error in Emacs, or in\r
81 any other correct JSON parser.\r
82 \r
83 However we are quite lucky: because of the possible values of the gmime\r
84 error codes, such an error cannot happen.\r
85 \r
86 The most common gmime error codes are 1 (expired signature), 2 (no\r
87 public key), 4 (expired key) and 8 (revoked key). The other possible\r
88 value is 16 (unsupported algorithm) but obviously it is much more rare.\r
89 If this happens, the current code will add '"errors": 10' (hex for\r
90 16...). This is valid JSON (it looks like a decimal number) but it is\r
91 incorrect (should be 16, not 10).\r
92 \r
93 With this patch, notmuch will correctly display '"errors": 16' if such a\r
94 case happens.\r
95 \r
96 (By the way, this issue was spotted by Austin Clements in\r
97 id:"20120117034714.GG16740@mit.edu", so he deserves the credits :))\r
98 \r
99 Regards,\r
100 \r
101 =2D-=20\r
102 Thomas/Schnouki\r
103 \r
104 --=-=-=\r
105 Content-Type: application/pgp-signature\r
106 \r
107 -----BEGIN PGP SIGNATURE-----\r
108 Version: GnuPG v1.4.11 (GNU/Linux)\r
109 \r
110 iQEcBAEBAgAGBQJPGV83AAoJEMPdciX+bh5IjeoIAJScqo3bRI0pJumtxrLA1OqB\r
111 eb3iYDptZ4a8i4oK15mj+PLERvUKPZEW6aggSfrb3Y3FJXNQZ0ilPgvnIIzSvXrF\r
112 i7VYk7xSjZhsudRgcGYPV1AQckhQ0DAQvOWmcgiCG15vGbHddKNfnBuFOfigSAq7\r
113 qhO0AN0j/hYwMGH0srF29rbLrAfU5Sw1H8GGCqBe8aqsvILlLUv1L0wOj7y6UcgJ\r
114 MtFjXwfhI39fWZMgRDnVekcNhCWwLeJPbzRLl/VqinhZvGOBn7J5jDZR9lznosTb\r
115 UIZgGEV8vZ2YjmuROWT9sqbmBbNBH6FRghlwC5ftELNBiRrsW5nqp+PSalRTdSs=\r
116 =Y8PS\r
117 -----END PGP SIGNATURE-----\r
118 --=-=-=--\r