Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 25 / fc07b6b226c33720b2a350e0ed7a613b71e9d4
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 AAF1D431FD0\r
6         for <notmuch@notmuchmail.org>; Fri, 25 Nov 2011 01:05:54 -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: 1.7\r
10 X-Spam-Level: *\r
11 X-Spam-Status: No, score=1.7 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, FREEMAIL_REPLY=2.499, RCVD_IN_DNSWL_LOW=-0.7]\r
14         autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id aefDJ86tZvdY for <notmuch@notmuchmail.org>;\r
18         Fri, 25 Nov 2011 01:05:54 -0800 (PST)\r
19 Received: from mail-vw0-f53.google.com (mail-vw0-f53.google.com\r
20         [209.85.212.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id 00119431FB6\r
23         for <notmuch@notmuchmail.org>; Fri, 25 Nov 2011 01:05:53 -0800 (PST)\r
24 Received: by vbbff1 with SMTP id ff1so3450456vbb.26\r
25         for <notmuch@notmuchmail.org>; Fri, 25 Nov 2011 01:05:52 -0800 (PST)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
27         d=googlemail.com; s=gamma;\r
28         h=message-id:content-type:mime-version:content-transfer-encoding:to\r
29         :from:in-reply-to:references:subject:date;\r
30         bh=/NpNJq19Pwnrlk7qj0RoyBHOAx8qUZ+QWuXsT7xMq9U=;\r
31         b=A9PaD1Gx0nLjIyhSf5D8jfVthCLsd0YJaTXSvzX6PJX/NY1Q9gANQvSQ7YrJPXg7Mw\r
32         7n38OsmhM9czG+4zGNz287amk+RUmXQjSWRe/aeMSzJLuOmFTN1JijuXL3HVc95bZG5b\r
33         htA2wIEzAZ7684LSY1TSG3loN06sLFgAFEk5c=\r
34 Received: by 10.52.22.170 with SMTP id e10mr32746421vdf.75.1322211952207;\r
35         Fri, 25 Nov 2011 01:05:52 -0800 (PST)\r
36 Received: from localhost ([2001:6a0:5001:b:a288:b4ff:fe40:300c])\r
37         by mx.google.com with ESMTPS id eu4sm33387367vdc.8.2011.11.25.01.04.08\r
38         (version=TLSv1/SSLv3 cipher=OTHER);\r
39         Fri, 25 Nov 2011 01:05:51 -0800 (PST)\r
40 Message-ID: <4ecf5a6f.84b8340a.1db5.045f@mx.google.com>\r
41 Content-Type: text/plain; charset="utf-8"\r
42 MIME-Version: 1.0\r
43 Content-Transfer-Encoding: quoted-printable\r
44 To: David Bremner <david@tethera.net>,\r
45         Antoine Amarilli <antoine.amarilli@ens.fr>, notmuch@notmuchmail.org\r
46 From: Patrick Totzke <patricktotzke@googlemail.com>\r
47 In-Reply-To: <8762i98pnh.fsf@zancas.localnet>\r
48 References: <20111106221554.GA23240@clipper.ens.fr>\r
49         <8762i98pnh.fsf@zancas.localnet>\r
50 Subject: =?utf-8?q?Re=3A_python-notmuch_decoding_error_on_a_message?=\r
51 Date: Fri, 25 Nov 2011 09:04:06 +0000\r
52 X-BeenThere: notmuch@notmuchmail.org\r
53 X-Mailman-Version: 2.1.13\r
54 Precedence: list\r
55 List-Id: "Use and development of the notmuch mail system."\r
56         <notmuch.notmuchmail.org>\r
57 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
59 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
60 List-Post: <mailto:notmuch@notmuchmail.org>\r
61 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
62 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
64 X-List-Received-Date: Fri, 25 Nov 2011 09:05:54 -0000\r
65 \r
66 Silly question: how do i get Antoine's msg stup into notmuch? i tried\r
67 using pythons mailbox lib to add this string to one of my mailboxes, which =\r
68 works fine.\r
69 but upon `notmuch new` I get something along the lines of "skipped non-mail=\r
70  file $myfile"..\r
71 \r
72 back to the topic:\r
73 I find it hichgly suprising that this decode fails because one can easily d=\r
74 o sth like:\r
75 \r
76 ```\r
77 >>>'=3D?utf-8?B?M+ht?=3D =3D?utf-8?Q?e?=3D'.decode('UTF-8')\r
78 u'=3D?utf-8?B?M+ht?=3D =3D?utf-8?Q?e?=3D'\r
79 ```\r
80 So the actual string should not be the problem. Apparently,\r
81 the string as its stored in the index is not plain ascii anymore, which it =\r
82 was in the msg.\r
83 I thought notmuch stores exacctly what it gets?\r
84 \r
85 Apart from this, I'd recommend replacing all decodes to unicode objects\r
86 by a subroutine that does the following:\r
87 If a global property notmuch.DEBUG is set to true: decode as is,\r
88 which will raise these exceptions upon errors\r
89 else: use .decode('UTF-8', errors=3D'ignore').\r
90 \r
91 In case the mail is not malformed, it will not contain any non-ascii symbol=\r
92 s whatsoever,\r
93 so both ways should work. If you happen to deal with a malformed mail, you'=\r
94 d get\r
95 the problematic symbols omitted (beware of this when doing cryptostuff).\r
96 \r
97 what do you think?\r
98 /p\r
99 \r
100 \r
101 Quoting David Bremner (2011-11-24 16:13:22)\r
102 >On Sun, 6 Nov 2011 23:15:54 +0100, Antoine Amarilli <antoine.amarilli@ens.=\r
103 fr> wrote:\r
104 >> Hello,\r
105 >> =\r
106 \r
107 >> The attached message makes python-notmuch crash when trying to access it=\r
108  (see\r
109 >> attached log).\r
110 >> =\r
111 \r
112 >> I don't know if the encoding of Subject is valid or not, but it would pr=\r
113 obably\r
114 >> be better anyway to ignore decoding errors and return some approximation=\r
115  of\r
116 >> Subject instead of failing like this.\r
117 >> =\r
118 \r
119 >\r
120 >I get a set of critical errors about forgetting to call g_type_init.\r
121 >\r
122 >We actually call g_type_init in the CLI now, thanks to =\r
123 \r
124 >   =\r
125 \r
126 >   id:"1311625989-97755-1-git-send-email-aaronecay@gmail.com"\r
127 >\r
128 >but it sounds like this probably needs to be called either in libnotmuch\r
129 >or in the bindings. =\r
130 \r
131 >\r
132 >For what it is worth this message decodes fine in the CLI\r
133 >\r
134 >d\r
135 >_______________________________________________\r
136 >notmuch mailing list\r
137 >notmuch@notmuchmail.org\r
138 >http://notmuchmail.org/mailman/listinfo/notmuch\r
139 \r