Re: Filesystem functionality used by notmuch
[notmuch-archives.git] / 0b / 341e015fdbcfe52d48efaa0d18a2374f66bd80
1 Return-Path: <Sebastian@SSpaeth.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 B69C3429E21\r
6         for <notmuch@notmuchmail.org>; Mon,  2 Jan 2012 07:16:04 -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: -0.09\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.09 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         RCVD_IN_DNSWL_NONE=-0.0001, T_MIME_NO_TEXT=0.01] 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 elfSz+hsIhdd for <notmuch@notmuchmail.org>;\r
17         Mon,  2 Jan 2012 07:16:04 -0800 (PST)\r
18 Received: from homiemail-a19.g.dreamhost.com (mailbigip.dreamhost.com\r
19         [208.97.132.5])\r
20         by olra.theworths.org (Postfix) with ESMTP id 3D0F1431FD0\r
21         for <notmuch@notmuchmail.org>; Mon,  2 Jan 2012 07:16:04 -0800 (PST)\r
22 Received: from homiemail-a19.g.dreamhost.com (localhost [127.0.0.1])\r
23         by homiemail-a19.g.dreamhost.com (Postfix) with ESMTP id 90228604078;\r
24         Mon,  2 Jan 2012 07:16:03 -0800 (PST)\r
25 DomainKey-Signature: a=rsa-sha1; c=nofws; d=SSpaeth.de; h=from:to:subject\r
26         :in-reply-to:references:date:message-id:mime-version:\r
27         content-type; q=dns; s=sspaeth.de; b=B5le8+4IYFdg53fAya3npDWPGHX\r
28         /yn2YIp0qh3qZmQBQRc5dAsKDjj9REKHhtlkGSTC3G+/93k05c54ToPJUNPR9SLY\r
29         n4n1RU8KNBo0H1j899H0ZSCNr30jDYWiulAFNJ2cCa+HpFW5scaPzPLd16a9ypLu\r
30         n1oGsiPmkvcVMNPI=\r
31 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=SSpaeth.de; h=from:to\r
32         :subject:in-reply-to:references:date:message-id:mime-version:\r
33         content-type; s=sspaeth.de; bh=YGlxQQ1wThvp91MrqIyDN36ZNJg=; b=I\r
34         lTfynGpVTsUbouy5HhOkq2LB5gDn4EV7ijamuWre2pYyuse6vPDr/pz0aVUOW8oo\r
35         9Zo2uz/xwr/KhtOdh5AIJaq3uydSv7XYrrDIL9I+RPSsEspuXTRWYKX1AwjtRiPd\r
36         UsKQEusGUXCWBQq/nQXDcC9yg29g38jys46VgsO/cA=\r
37 Received: from spaetzbook.sspaeth.de (unknown [176.46.227.178])\r
38         (Authenticated sender: fax@sspaeth.de)\r
39         by homiemail-a19.g.dreamhost.com (Postfix) with ESMTPA id E603B604061; \r
40         Mon,  2 Jan 2012 07:16:01 -0800 (PST)\r
41 Received: by spaetzbook.sspaeth.de (sSMTP sendmail emulation);\r
42         Mon, 02 Jan 2012 16:15:59 +0100\r
43 From: Sebastian Spaeth <Sebastian@SSpaeth.de>\r
44 To: Justus Winter <4winter@informatik.uni-hamburg.de>, notmuch@notmuchmail.org\r
45 Subject: Re: [PATCH 5/7] py3k: the basestring and unicode types are removed in\r
46         python 3\r
47 In-Reply-To:\r
48  <1323860305-15802-6-git-send-email-4winter@informatik.uni-hamburg.de>\r
49 References:\r
50  <1323860305-15802-1-git-send-email-4winter@informatik.uni-hamburg.de>\r
51         <1323860305-15802-6-git-send-email-4winter@informatik.uni-hamburg.de>\r
52 User-Agent: Notmuch/0.10+58~g935365d (http://notmuchmail.org) Emacs/23.3.1\r
53         (x86_64-pc-linux-gnu)\r
54 Date: Mon, 02 Jan 2012 16:15:58 +0100\r
55 Message-ID: <87hb0ekudt.fsf@SSpaeth.de>\r
56 MIME-Version: 1.0\r
57 Content-Type: multipart/signed; boundary="=-=-=";\r
58         micalg=pgp-sha1; protocol="application/pgp-signature"\r
59 X-BeenThere: notmuch@notmuchmail.org\r
60 X-Mailman-Version: 2.1.13\r
61 Precedence: list\r
62 List-Id: "Use and development of the notmuch mail system."\r
63         <notmuch.notmuchmail.org>\r
64 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
65         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
66 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
67 List-Post: <mailto:notmuch@notmuchmail.org>\r
68 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
69 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
70         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
71 X-List-Received-Date: Mon, 02 Jan 2012 15:16:04 -0000\r
72 \r
73 --=-=-=\r
74 Content-Transfer-Encoding: quoted-printable\r
75 \r
76 Happy new year. Pushed patches 1-4 of this series so far. Looking fine,\r
77 but ugh, the below seems like a rather ugly hack in a function that is\r
78 probably called quite often.\r
79 \r
80 Isn't there a more pretty variant avoiding these sys.version_info checks\r
81 all over the place?\r
82 \r
83 > @@ -200,9 +201,9 @@ def _str(value):\r
84 >=20=20\r
85 >      C++ code expects strings to be well formatted and\r
86 >      unicode strings to have no null bytes."""\r
87 > -    if not isinstance(value, basestring):\r
88 > +    if not isinstance(value, basestring if sys.version_info[0] =3D=3D 2 =\r
89 else str):\r
90 >          raise TypeError("Expected str or unicode, got %s" % str(type(val=\r
91 ue)))\r
92 > -    if isinstance(value, unicode):\r
93 > +    if sys.version_info[0] =3D=3D 3 or isinstance(value, unicode):\r
94 >          return value.encode('UTF-8')\r
95 >      return value\r
96 \r
97 --=-=-=\r
98 Content-Type: application/pgp-signature\r
99 \r
100 -----BEGIN PGP SIGNATURE-----\r
101 Version: GnuPG v1.4.11 (GNU/Linux)\r
102 \r
103 iEYEARECAAYFAk8Byi4ACgkQVYX1jMgnoGK4SACfd/8d+iAeYWWFclRaKC4jfq7j\r
104 BcEAn3K/dWWTo9iumTX5NjnO4XPLBdCB\r
105 =XUSg\r
106 -----END PGP SIGNATURE-----\r
107 --=-=-=--\r