1 Return-Path: <nobody@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 12681431FAF
\r
6 for <notmuch@notmuchmail.org>; Tue, 9 Jul 2013 02:49:47 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0.002 tagged_above=-999 required=5
\r
12 tests=[TVD_RCVD_SPACE_BRACKET=0.001, UNPARSEABLE_RELAY=0.001]
\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 IISlbJzESpJX for <notmuch@notmuchmail.org>;
\r
17 Tue, 9 Jul 2013 02:49:39 -0700 (PDT)
\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 B2B4C431FAE
\r
22 for <notmuch@notmuchmail.org>; Tue, 9 Jul 2013 02:49:38 -0700 (PDT)
\r
23 Received: from mail.jade-hamburg.de (mail.jade-hamburg.de [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 6D5456A4A0C
\r
27 for <notmuch@notmuchmail.org>; Tue, 9 Jul 2013 11:49:32 +0200 (CEST)
\r
28 Received: by mail.jade-hamburg.de (Postfix, from userid 401)
\r
29 id B8578DF2A2; Tue, 9 Jul 2013 11:49:31 +0200 (CEST)
\r
30 Received: from thinkbox.jade-hamburg.de (cryptobitch.de [88.198.7.68])
\r
31 (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
\r
32 (No client certificate requested) (Authenticated sender: teythoon)
\r
33 by mail.jade-hamburg.de (Postfix) with ESMTPSA id 6C537DF28B
\r
34 for <notmuch@notmuchmail.org>; Tue, 9 Jul 2013 11:49:27 +0200 (CEST)
\r
35 Received: from teythoon by thinkbox.jade-hamburg.de with local (Exim 4.80)
\r
36 (envelope-from <nobody@thinkbox.jade-hamburg.de>) id 1UwUY2-0001Qr-71
\r
37 for notmuch@notmuchmail.org; Tue, 09 Jul 2013 11:49:26 +0200
\r
38 Resent-Date: Tue, 09 Jul 2013 11:49:26 +0200
\r
39 Resent-Message-Id: <E1UwUY2-0001Qr-71@thinkbox.jade-hamburg.de>
\r
40 Received: from mailhost.informatik.uni-hamburg.de [134.100.9.70]
\r
41 by jadE.jadE-Hamburg.de with IMAP (fetchmail-6.3.9-rc2)
\r
42 for <teythoon@localhost> (single-drop);
\r
43 Sun, 07 Jul 2013 09:01:19 +0200 (CEST)
\r
44 Received: from mailhost.informatik.uni-hamburg.de ([unix socket])
\r
45 by mailhost (Cyrus v2.3.16) with LMTPA;
\r
46 Sun, 07 Jul 2013 09:00:24 +0200
\r
47 X-Sieve: CMU Sieve 2.3
\r
48 Received: from localhost (localhost [127.0.0.1])
\r
49 by mailhost.informatik.uni-hamburg.de (Postfix) with ESMTP id 085F02BC
\r
50 for <4winter@informatik.uni-hamburg.de>;
\r
51 Sun, 7 Jul 2013 09:00:24 +0200 (CEST)
\r
52 X-Virus-Scanned: amavisd-new at informatik.uni-hamburg.de
\r
53 Received: from mailhost.informatik.uni-hamburg.de ([127.0.0.1])
\r
54 by localhost (mailhost.informatik.uni-hamburg.de [127.0.0.1])
\r
55 (amavisd-new, port 10024)
\r
56 with LMTP id 4QEaQhRmctP4 for <4winter@informatik.uni-hamburg.de>;
\r
57 Sun, 7 Jul 2013 09:00:20 +0200 (CEST)
\r
58 X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5
\r
59 BL_NJABL=SKIP(-1.5) CL_IP_EQ_HELO_IP=-2 (check from: .aidecoe. - helo:
\r
60 .mail-bk0-f41.google. - helo-domain: .google.)
\r
61 FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5
\r
62 Received: from mail-bk0-f41.google.com (mail-bk0-f41.google.com
\r
63 [209.85.214.41]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
64 (Client CN "smtp.gmail.com",
\r
65 Issuer "Google Internet Authority" (verified OK))
\r
66 by mailhost.informatik.uni-hamburg.de (Postfix) with ESMTPS id 54E692BB
\r
67 for <4winter@informatik.uni-hamburg.de>;
\r
68 Sun, 7 Jul 2013 09:00:19 +0200 (CEST)
\r
69 Received: by mail-bk0-f41.google.com with SMTP id jc3so1465854bkc.14
\r
70 for <4winter@informatik.uni-hamburg.de>;
\r
71 Sun, 07 Jul 2013 00:00:19 -0700 (PDT)
\r
72 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
73 d=google.com; s=20120113;
\r
74 h=from:to:subject:user-agent:date:message-id:mime-version
\r
75 :content-type:x-gm-message-state;
\r
76 bh=iV83mH3O1R0iAxhhbmEE6gBIGmdWraTzccthWZKWoy8=;
\r
77 b=YNTPVhysrfqll3pNjX14dQpeAsy6UcUCgd8FvSz09/S9XEaYyYg5yeHz2wrvDZlBlX
\r
78 1bBwV+GY3ibYNYfUyo6JqrhtJ+sERLnW1XYudk3Fk6u96XzFzuttZpKCtWKbvltjfVph
\r
79 TM41v814YdxlN7A+sk3DQ7jUf7+On0EzDty5sulB+b0Xt1U/zPePrYCJoQYsDhwrIXlQ
\r
80 yn4tgvG88bU+PWXI5pWmeQE3SalkUZn/y9rkULyiFPMJDMTKxpZFdkwB+DzgXofkp21j
\r
81 lWaP6S27oXo2vmXDph7WDtSb7X2yKfFkwtNvSCRtj/BnPr4zYZuVGvtd4TLW/2CWs8+e
\r
83 X-Received: by 10.205.130.67 with SMTP id hl3mr2583382bkc.61.1373180419276;
\r
84 Sun, 07 Jul 2013 00:00:19 -0700 (PDT)
\r
85 From: Amadeusz =?utf-8?B?xbtvxYJub3dza2k=?= <aidecoe@aidecoe.name>
\r
86 To: Justus Winter <4winter@informatik.uni-hamburg.de>
\r
87 Subject: [notmuch] Unicode in Python bindings
\r
88 User-Agent: Notmuch/0.15.2 (http://notmuchmail.org) Emacs/24.3.1
\r
89 (x86_64-pc-linux-gnu)
\r
90 Date: Sun, 07 Jul 2013 09:00:16 +0200
\r
91 Message-ID: <87txk6zwfz.fsf@raeviah.aidecoe.name>
\r
93 Content-Type: multipart/signed; boundary="=-=-=";
\r
94 micalg=pgp-sha1; protocol="application/pgp-signature"
\r
96 ALoCoQl9lHlNXHB3cdksAJhxQ8jpPMCVt2kXej1sNqQ7ciTTAWy6VBuT8bk7E3ijw0KPgILxZGk/
\r
97 X-Alot-OpenPGP-Signature-Valid: True
\r
98 X-Alot-OpenPGP-Signature-Message: Valid: F0134531E1DBFAB5
\r
99 Resent-From: Justus Winter <4winter@informatik.uni-hamburg.de>
\r
100 Resent-To: notmuch mailing list <notmuch@notmuchmail.org>
\r
101 X-BeenThere: notmuch@notmuchmail.org
\r
102 X-Mailman-Version: 2.1.13
\r
104 List-Id: "Use and development of the notmuch mail system."
\r
105 <notmuch.notmuchmail.org>
\r
106 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
107 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
108 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
109 List-Post: <mailto:notmuch@notmuchmail.org>
\r
110 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
111 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
112 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
113 X-List-Received-Date: Tue, 09 Jul 2013 09:49:47 -0000
\r
116 Content-Type: text/plain; charset=utf-8
\r
117 Content-Transfer-Encoding: quoted-printable
\r
121 I have come across a problem with Unicode [1] in afew mail filter which
\r
122 uses Notmuch Python bindings and it has eventually bringed us to
\r
123 confusion about Unicode handling in Python bindings.
\r
125 Shouldn't __unicode__() methods return value of type unicode? Let's
\r
126 take an example of __unicode__() method from Message class:
\r
128 def __unicode__(self):
\r
129 format =3D "%s (%s) (%s)"
\r
130 return format % (self.get_header('from'),
\r
131 self.get_tags(),=20=20=20=20=20=20=20=20=20=20=20=
\r
133 date.fromtimestamp(self.get_date()),
\r
136 format is of type str, not unicode and method is eventually going to
\r
137 return str, while the user of the API is expecting unicode type.
\r
139 I haven't programmed in Python 3, yet - only in Python 2, so maybe I am
\r
140 missing something. When I was writing a big project in Python 2, I have
\r
141 eventually decided to use u'' literals everywhere and decode any str to
\r
142 unicode ASAP - and this solved all issues wrt encodings. I guess that
\r
143 mixing Python 2 and 3 gets even more problematic.
\r
145 Could you review (and fix if it is needed) Python bindings in context of
\r
146 unicode handling, please?
\r
149 [1] https://github.com/teythoon/afew/issues/36
\r
155 Amadeusz =C5=BBo=C5=82nowski
\r
158 Content-Type: application/pgp-signature
\r
160 -----BEGIN PGP SIGNATURE-----
\r
161 Version: GnuPG v2.0.20 (GNU/Linux)
\r
163 iQEcBAEBAgAGBQJR2RIAAAoJEPATRTHh2/q1jeEH/2+RY69kyuKNz7gdBY5IvKrV
\r
164 f1WYHMeGkHFcWMC6Rm6dbaXrzfJe6IP7XW+3MaWNErbfsBQzRiUdI+DPPUQZOpI9
\r
165 KVFCx1wa4jtBrf++kUowV3GlKGyyoDr8W9Gii8wnAw7rRRX9Qv4CP0sNhxXLj5xR
\r
166 WcmjFLGvuEUXUVZZCAqKfpuXa+BA/ix1gPSfHEK3Gr8TkKbsFzR2GGZxpyq+znsq
\r
167 NrYBLcD2zAP9UUQ+WVKpo8+x9y++WnEkduWqDX2exvUhHl2u3Rl6co0Mg03/HtSQ
\r
168 1Bb7MbbATEDC1KD7GbxQ42XOEEzXjiIXeAjGQFmEVtTIOalSbZ5TFVJF1OGWlKU=
\r
170 -----END PGP SIGNATURE-----
\r