[PATCH] This patch is a little finger excercise for working with git. I found a piece...
[notmuch-archives.git] / 15 / 1be3b099230ccffe5fe9e6d1f0bd3886d53a4f
1 Return-Path: <gmn-notmuch@m.gmane.org>\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 56EB9429E26\r
6         for <notmuch@notmuchmail.org>; Fri, 22 Jul 2011 07:15:18 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\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 k-xbM-nF5TJY for <notmuch@notmuchmail.org>;\r
16         Fri, 22 Jul 2011 07:15:14 -0700 (PDT)\r
17 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12])\r
18         by olra.theworths.org (Postfix) with ESMTP id 6B117431FD0\r
19         for <notmuch@notmuchmail.org>; Fri, 22 Jul 2011 07:15:14 -0700 (PDT)\r
20 Received: from list by lo.gmane.org with local (Exim 4.69)\r
21         (envelope-from <gmn-notmuch@m.gmane.org>) id 1QkGVT-0006fE-QN\r
22         for notmuch@notmuchmail.org; Fri, 22 Jul 2011 16:15:11 +0200\r
23 Received: from HSI-KBW-095-208-113-104.hsi5.kabel-badenwuerttemberg.de\r
24         ([95.208.113.104]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian))\r
25         id 1AlnuQ-0007hv-00\r
26         for <notmuch@notmuchmail.org>; Fri, 22 Jul 2011 16:15:11 +0200\r
27 Received: from michael by\r
28         HSI-KBW-095-208-113-104.hsi5.kabel-badenwuerttemberg.de with\r
29         local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00\r
30         for <notmuch@notmuchmail.org>; Fri, 22 Jul 2011 16:15:11 +0200\r
31 X-Injected-Via-Gmane: http://gmane.org/\r
32 To: notmuch@notmuchmail.org\r
33 From: Michael Heinrich <michael@haas-heinrich.de>\r
34 Subject: [Patch] tag.py: Bugfix to avoid decode() on a NoneType object\r
35 Date: Fri, 22 Jul 2011 14:11:41 +0000 (UTC)\r
36 Lines: 32\r
37 Message-ID: <loom.20110722T160702-94@post.gmane.org>\r
38 Mime-Version: 1.0\r
39 Content-Type: text/plain; charset=us-ascii\r
40 Content-Transfer-Encoding: 7bit\r
41 X-Complaints-To: usenet@dough.gmane.org\r
42 X-Gmane-NNTP-Posting-Host: sea.gmane.org\r
43 User-Agent: Loom/3.14 (http://gmane.org/)\r
44 X-Loom-IP: 95.208.113.104 (Mozilla/5.0 (X11; Linux x86_64;\r
45         rv:2.0.1) Gecko/20100101 Firefox/4.0.1)\r
46 X-BeenThere: notmuch@notmuchmail.org\r
47 X-Mailman-Version: 2.1.13\r
48 Precedence: list\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: Fri, 22 Jul 2011 14:15:18 -0000\r
59 \r
60 Dear all,\r
61 \r
62 with current head I get following error in my python scripts when I read the\r
63 tags of a message:\r
64 \r
65   File "/home/heinrich/.local/lib/python2.6/site-packages/notmuch/tag.py", line\r
66 88, in next\r
67     tag = Tags._get(self._tags).decode('utf-8')\r
68 \r
69 \r
70 Here is a patch:\r
71 \r
72 diff --git a/bindings/python/notmuch/tag.py b/bindings/python/notmuch/tag.py\r
73 index 65a9118..e9049fc 100644\r
74 --- a/bindings/python/notmuch/tag.py\r
75 +++ b/bindings/python/notmuch/tag.py\r
76 @@ -85,10 +85,12 @@ class Tags(object):\r
77              raise NotmuchError(STATUS.NOT_INITIALIZED)\r
78          # No need to call nmlib.notmuch_tags_valid(self._tags);\r
79          # Tags._get safely returns None, if there is no more valid tag.\r
80 -        tag = Tags._get(self._tags).decode('utf-8')\r
81 +        tag = Tags._get(self._tags)\r
82          if tag is None:\r
83              self._tags = None\r
84              raise StopIteration\r
85 +        else:\r
86 +            tag = tag.decode('utf-8')\r
87          nmlib.notmuch_tags_move_to_next(self._tags)\r
88          return tag\r
89  \r
90 \r
91 Michael.\r
92 \r