database error
[notmuch-archives.git] / f4 / e2b9332a8addd14432d3357039d6fe80711adc
1 Return-Path: <david@tethera.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 arlo.cworth.org (Postfix) with ESMTP id 440C26DE141B\r
6  for <notmuch@notmuchmail.org>; Tue, 16 Feb 2016 05:04:12 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.307\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.307 tagged_above=-999 required=5 tests=[AWL=0.244,\r
12   RP_MATCHES_RCVD=-0.55, SPF_PASS=-0.001] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id s3vrzFIj2p0b for <notmuch@notmuchmail.org>;\r
16  Tue, 16 Feb 2016 05:04:10 -0800 (PST)\r
17 Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
18  by arlo.cworth.org (Postfix) with ESMTPS id 1669C6DE02C9\r
19  for <notmuch@notmuchmail.org>; Tue, 16 Feb 2016 05:04:09 -0800 (PST)\r
20 Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
21  (envelope-from <david@tethera.net>)\r
22  id 1aVfHq-0002cb-Ri; Tue, 16 Feb 2016 08:03:26 -0500\r
23 Received: (nullmailer pid 25980 invoked by uid 1000);\r
24  Tue, 16 Feb 2016 13:04:07 -0000\r
25 From: David Bremner <david@tethera.net>\r
26 To: "W. Trevor King" <wking@tremily.us>, notmuch@notmuchmail.org\r
27 Subject: Re: [PATCH] nmbug: Allow Unicode tags and IDs in Python 2\r
28 In-Reply-To:\r
29  <e287050a10ce1d2120db996d2d200f610370a44e.1455513965.git.wking@tremily.us>\r
30 References:\r
31  <e287050a10ce1d2120db996d2d200f610370a44e.1455513965.git.wking@tremily.us>\r
32 User-Agent: Notmuch/0.21+26~g9404723 (http://notmuchmail.org) Emacs/24.5.1\r
33  (x86_64-pc-linux-gnu)\r
34 Date: Tue, 16 Feb 2016 09:04:07 -0400\r
35 Message-ID: <87lh6kvmbc.fsf@zancas.localnet>\r
36 MIME-Version: 1.0\r
37 Content-Type: text/plain; charset=utf-8\r
38 Content-Transfer-Encoding: quoted-printable\r
39 X-BeenThere: notmuch@notmuchmail.org\r
40 X-Mailman-Version: 2.1.20\r
41 Precedence: list\r
42 List-Id: "Use and development of the notmuch mail system."\r
43  <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
45  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
50  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Tue, 16 Feb 2016 13:04:12 -0000\r
52 \r
53 "W. Trevor King" <wking@tremily.us> writes:\r
54 \r
55 > Avoid a UnicodeWarning and broken pipe on 'nmbug commit' in Python 2\r
56 > when a tag or message ID contains non-ASCII characters [1].\r
57 >\r
58 > There are a number of Python bugs associated with this behavior\r
59 > [2,3,4,5,6].  There's also some useful background in [8].  [3] lead to\r
60 > the currently working Python 3 implementation, which encodes to UTF-8\r
61 > by default and has 'encoding' and 'errors' arguments [7].  This commit\r
62 > follows that approach in a way that's compatible with both Python 2\r
63 > and Python 3.  Coercing to UTF-8 (regardless of locale) gives us\r
64 > consistent tag IDs for sharing between users.\r
65 \r
66 I'm not sure what "tag IDs" are. Do you mean message-ids here? or "tags\r
67 and IDs"?\r
68 \r
69 At first I thought there might be problems with non-utf8 message-ids,\r
70 but that turns out not to be the case [1].  It seems like it would take\r
71 a fairly heroic effort to get non-UTF8 tags into the database (perhaps\r
72 by calling the library interface with bad strings?) so we can probably\r
73 ignore this case. It might be good to document the limitation though,\r
74 since AFAIK, dump and restore can roundtrip any old crap.\r
75 \r
76 \r
77 >\r
78 > The 'isnumeric' check identifies Unicode instances in both Python 2\r
79 > [9] and Python 3 [10].\r
80 >\r
81 \r
82 I still haven't really tried to understand this part, but probably it\r
83 deserves inline documentation.\r
84 \r
85 > ---\r
86 > I haven't checked the other commands for issues with Unicode IDs or\r
87 > tags.  It's possible that in addition to this explicit encoding to\r
88 > UTF-8, we'll also want explicit decoding from UTF-8 when reading from\r
89 > Git trees (for 'nmbug checkout' and 'nmbug status').\r
90 \r
91 Yes, this seems to be a problem, with the patch applied I can commit,\r
92 but the same utf-8 message-id causes problems.\r
93 \r
94 bremner@zancas:~/software/upstream/notmuch$ ./devel/nmbug/nmbug status\r
95 U       D1B4DEBCAFFC4A05A4D4349A6EC5C9D8@=C3=83=C3=82=C3=83=C3=82=C2=A5=C3=83=C3=\r
96 =82=C2=B0=C3=83=C3=82=C2=A3=C3=83=C3=82=C2=A5=C3=83=C3=82=C2=A9-=C3=83=C3=\r
97 =82=C3=83=C3=82 unread\r
98 A       D1B4DEBCAFFC4A05A4D4349A6EC5C9D8@=C3=83=C3=83=C2=A5=C3=83=C2=B0=C3=83=C2=\r
99 =A3=C3=83=C2=A5=C3=83=C2=A9-=C3=83=C3=83        unread\r
100 \r
101 bremner@zancas:~/software/upstream/notmuch$ delve -a -1 ~/Maildir/.notmuch/=\r
102 xapian | grep D1B4DEBCAFFC4A05A4D4349A6EC5C9D8\r
103 QD1B4DEBCAFFC4A05A4D4349A6EC5C9D8@=C3=91=C3=A5=C3=B0=C3=A3=C3=A5=C3=A9-=C3=\r
104 =8F=C3=8A\r
105 \r
106 [1]: id:87si0svnim.fsf@zancas.localnet\r