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 89529429E25
\r
6 for <notmuch@notmuchmail.org>; Fri, 12 Aug 2011 06:23:37 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 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, RCVD_IN_DNSWL_LOW=-0.7] 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 d33nzs1lezMe for <notmuch@notmuchmail.org>;
\r
17 Fri, 12 Aug 2011 06:23:37 -0700 (PDT)
\r
18 Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com
\r
19 [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id D42E5431FB6
\r
22 for <notmuch@notmuchmail.org>; Fri, 12 Aug 2011 06:23:36 -0700 (PDT)
\r
23 Received: by wyg36 with SMTP id 36so2429200wyg.26
\r
24 for <notmuch@notmuchmail.org>; Fri, 12 Aug 2011 06:23:34 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
26 d=googlemail.com; s=gamma;
\r
27 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
\r
28 bh=x+tLK+BIH7R6DFAp4wzAe+gNJ5e1zJMDh2myoRQi/Ds=;
\r
29 b=ffjZm29es/hBKWtKGKkqeIQJZ4nm7OM4OvkhNyVN5GKrmHQIE5/3gZPlUQ2A5aWSit
\r
30 twOTAJcJ9qXOYgyco+feI/yWC+06JkQ/uhHEvbzUo/eafFtMwQx5hnnvrb3mbMW9wzw9
\r
31 lHoPuxI3alUcTFXaiRyjD9whoJcOIDDwFy258=
\r
32 Received: by 10.216.131.134 with SMTP id m6mr283278wei.78.1313155413940;
\r
33 Fri, 12 Aug 2011 06:23:33 -0700 (PDT)
\r
34 Received: from localhost (dhcp-91-036.inf.ed.ac.uk [129.215.91.36])
\r
35 by mx.google.com with ESMTPS id e7sm727170wed.33.2011.08.12.06.23.31
\r
36 (version=TLSv1/SSLv3 cipher=OTHER);
\r
37 Fri, 12 Aug 2011 06:23:32 -0700 (PDT)
\r
38 From: Patrick Totzke <patricktotzke@googlemail.com>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [PATCH] [python] decode headers from utf-8 to unicode
\r
41 Date: Fri, 12 Aug 2011 14:23:28 +0100
\r
42 Message-Id: <1313155408-17156-1-git-send-email-patricktotzke@gmail.com>
\r
43 X-Mailer: git-send-email 1.7.4.1
\r
44 In-Reply-To: <87wrejnj1i.fsf@SSpaeth.de>
\r
45 References: <87wrejnj1i.fsf@SSpaeth.de>
\r
46 Cc: patrick <p.totzke@ed.ac.uk>
\r
47 X-BeenThere: notmuch@notmuchmail.org
\r
48 X-Mailman-Version: 2.1.13
\r
50 List-Id: "Use and development of the notmuch mail system."
\r
51 <notmuch.notmuchmail.org>
\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
55 List-Post: <mailto:notmuch@notmuchmail.org>
\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
58 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
59 X-List-Received-Date: Fri, 12 Aug 2011 13:23:37 -0000
\r
61 From: patrick <p.totzke@ed.ac.uk>
\r
63 as mail headers are stored as utf-8 in the index,
\r
64 it is safe to return them as unicode strings directly
\r
66 bindings/python/notmuch/message.py | 4 ++--
\r
67 bindings/python/notmuch/thread.py | 4 ++--
\r
68 2 files changed, 4 insertions(+), 4 deletions(-)
\r
70 diff --git a/bindings/python/notmuch/message.py b/bindings/python/notmuch/message.py
\r
71 index 435a05d..ae6ae1b 100644
\r
72 --- a/bindings/python/notmuch/message.py
\r
73 +++ b/bindings/python/notmuch/message.py
\r
74 @@ -395,7 +395,7 @@ class Message(object):
\r
75 header = Message._get_header(self._msg, header)
\r
77 raise NotmuchError(STATUS.NULL_POINTER)
\r
79 + return header.decode('UTF-8')
\r
81 def get_filename(self):
\r
82 """Returns the file path of the message file
\r
83 @@ -747,7 +747,7 @@ class Message(object):
\r
84 """A message() is represented by a 1-line summary"""
\r
86 msg['from'] = self.get_header('from')
\r
87 - msg['tags'] = str(self.get_tags())
\r
88 + msg['tags'] = self.get_tags()
\r
89 msg['date'] = date.fromtimestamp(self.get_date())
\r
90 return "%(from)s (%(date)s) (%(tags)s)" % (msg)
\r
92 diff --git a/bindings/python/notmuch/thread.py b/bindings/python/notmuch/thread.py
\r
93 index 60f6c29..120f925 100644
\r
94 --- a/bindings/python/notmuch/thread.py
\r
95 +++ b/bindings/python/notmuch/thread.py
\r
96 @@ -292,7 +292,7 @@ class Thread(object):
\r
98 if self._thread is None:
\r
99 raise NotmuchError(STATUS.NOT_INITIALIZED)
\r
100 - return Thread._get_authors(self._thread)
\r
101 + return Thread._get_authors(self._thread).decode('UTF-8')
\r
103 def get_subject(self):
\r
104 """Returns the Subject of 'thread'
\r
105 @@ -302,7 +302,7 @@ class Thread(object):
\r
107 if self._thread is None:
\r
108 raise NotmuchError(STATUS.NOT_INITIALIZED)
\r
109 - return Thread._get_subject(self._thread)
\r
110 + return Thread._get_subject(self._thread).decode('UTF-8')
\r
112 def get_newest_date(self):
\r
113 """Returns time_t of the newest message date
\r