1 Return-Path: <tomi.ollila@iki.fi>
\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 9B47F431FBD
\r
6 for <notmuch@notmuchmail.org>; Tue, 4 Feb 2014 12:06:16 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id nxdL+jiJk2K4 for <notmuch@notmuchmail.org>;
\r
16 Tue, 4 Feb 2014 12:06:10 -0800 (PST)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id A32BB431FBC
\r
19 for <notmuch@notmuchmail.org>; Tue, 4 Feb 2014 12:06:10 -0800 (PST)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id 3B070100033;
\r
22 Tue, 4 Feb 2014 22:06:02 +0200 (EET)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: "W. Trevor King" <wking@tremily.us>
\r
25 Subject: Re: [PATCH 00/17] nmbug-status: Python-3-compabitility and general
\r
27 In-Reply-To: <20140204191453.GV14197@odin.tremily.us>
\r
28 References: <cover.1391424512.git.wking@tremily.us>
\r
29 <m2ha8frjgg.fsf@guru.guru-group.fi>
\r
30 <20140204005331.GQ14197@odin.tremily.us>
\r
31 <m2fvnzp3uh.fsf@guru.guru-group.fi>
\r
32 <20140204161142.GS14197@odin.tremily.us>
\r
33 <m2a9e6zppp.fsf@guru.guru-group.fi>
\r
34 <20140204191453.GV14197@odin.tremily.us>
\r
35 User-Agent: Notmuch/0.17+55~g4397960 (http://notmuchmail.org) Emacs/24.3.1
\r
36 (x86_64-unknown-linux-gnu)
\r
37 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
38 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
39 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
40 Date: Tue, 04 Feb 2014 22:06:01 +0200
\r
41 Message-ID: <m2fvnywsly.fsf@guru.guru-group.fi>
\r
43 Content-Type: text/plain; charset=utf-8
\r
44 Content-Transfer-Encoding: quoted-printable
\r
45 Cc: notmuch@notmuchmail.org
\r
46 X-BeenThere: notmuch@notmuchmail.org
\r
47 X-Mailman-Version: 2.1.13
\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: Tue, 04 Feb 2014 20:06:16 -0000
\r
60 On Tue, Feb 04 2014, "W. Trevor King" <wking@tremily.us> wrote:
\r
63 >> I don't know what to paste, so i paste this:
\r
66 >> Python 2.6.6 (r266:84292, Nov 21 2013, 12:39:37)=20
\r
67 >> [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
\r
68 >> Type "help", "copyright", "credits" or "license" for more information.
\r
70 > It looks like you left out:
\r
72 > from __future__ import unicode_literals
\r
74 > Can you try again with that line as the first command?
\r
76 >> >>> data =3D {'from': '\u017b'}
\r
77 >> >>> print(type(data['from']))=20
\r
80 > which is why your data is a 'str' and not a 'unicode' instance.
\r
82 >> >>> string =3D ' <td>{from}</td>\n'.format(**data)
\r
86 Quick update before getting to sleep:
\r
89 Python 2.6.6 (r266:84292, Nov 21 2013, 12:39:37)=20
\r
90 [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
\r
91 Type "help", "copyright", "credits" or "license" for more information.
\r
92 >>> from __future__ import print_function
\r
93 >>> from __future__ import unicode_literals
\r
94 >>> data =3D {'from': '\u017b'}
\r
95 >>> print(type(data['from']))
\r
97 >>> string =3D ' <td>{from}</td>\n'.format(**data)
\r
101 so getting success there
\r
103 $ PYTHONPATH=3D$PWD/bindings/python/ ./devel/nmbug/nmbug-status
\r
105 Traceback (most recent call last):
\r
106 File "devel/nmbug/nmbug-status", line 318, in <module>
\r
107 page.write(database=3Ddb, views=3Dconfig['views'])
\r
108 File "devel/nmbug/nmbug-status", line 94, in write
\r
109 self._write_view(database=3Ddatabase, view=3Dview, stream=3Dstream)
\r
110 File "devel/nmbug/nmbug-status", line 113, in _write_view
\r
111 self._write_threads(threads=3Dthreads, stream=3Dstream)
\r
112 File "devel/nmbug/nmbug-status", line 215, in _write_threads
\r
113 ).format(**message_display_data))
\r
114 File "/usr/lib64/python2.6/codecs.py", line 351, in write
\r
115 data, consumed =3D self.encode(object, self.errors)
\r
116 UnicodeEncodeError: 'ascii' codec can't encode character u'\u017b' in
\r
117 position 176: ordinal not in range(128)
\r
120 I'll dig deeper tomorrow.
\r