From 3c840c6cd6cf0019f1ffc12887ef844f16bd3d4b Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Tue, 4 Feb 2014 12:30:30 +0200 Subject: [PATCH] Re: [PATCH 00/17] nmbug-status: Python-3-compabitility and general refactoring --- d2/11f1c9c0ae73474fa0c8b93377e97eee6f9a13 | 117 ++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 d2/11f1c9c0ae73474fa0c8b93377e97eee6f9a13 diff --git a/d2/11f1c9c0ae73474fa0c8b93377e97eee6f9a13 b/d2/11f1c9c0ae73474fa0c8b93377e97eee6f9a13 new file mode 100644 index 000000000..59d08d661 --- /dev/null +++ b/d2/11f1c9c0ae73474fa0c8b93377e97eee6f9a13 @@ -0,0 +1,117 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 0E5C5431FBC + for ; Tue, 4 Feb 2014 02:30:48 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 8xBzQmuTLf2P for ; + Tue, 4 Feb 2014 02:30:40 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 9D17B431FAF + for ; Tue, 4 Feb 2014 02:30:40 -0800 (PST) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 4E55B100033; + Tue, 4 Feb 2014 12:30:31 +0200 (EET) +From: Tomi Ollila +To: "W. Trevor King" +Subject: Re: [PATCH 00/17] nmbug-status: Python-3-compabitility and general + refactoring +In-Reply-To: <20140204005331.GQ14197@odin.tremily.us> +References: + + <20140204005331.GQ14197@odin.tremily.us> +User-Agent: Notmuch/0.17+55~g4397960 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: quoted-printable +Cc: notmuch@notmuchmail.org +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Tue, 04 Feb 2014 10:30:48 -0000 + +On Tue, Feb 04 2014, "W. Trevor King" wrote: + +> On Mon, Feb 03, 2014 at 11:10:23PM +0200, Tomi Ollila wrote: +>> data['message-id-term'] =3D 'id:"{}"'.format(value) +>> ValueError: zero length field name in format +> +> Oops, Python 2.6 still needs explicit indexes ('{0}', not '{}'). It's +> an easy fix, so I'll queue it for v2. You're still going to need +> Python 2.7 or greater for collections.OrderedDict(). We could word +> around that too, but do we really care about 2.6? I don't expect that +> the installed nmbug-status userbase is so large and backward that +> upgrading to 2.7 will be that hard ;). 2.6 isn't even getting +> security fixes anymore [1], so I think it's time to migrate :p. + +Probably not many cares about 2.6; I already use argparse and I can add +that OrderedDict() too. Still {0} is easy enough to do :D. I am running +this notmuch & nmbug in Scientific Linux 6.2 machine which has python 2.6 +-- and this is the only machine where I can review your nmbug-status +changes ;) + +>> File "devel/nmbug/nmbug-status", line 197, in _write_threads +>> ).format(**message_display_data)) +>> File "/usr/lib64/python2.6/codecs.py", line 351, in write +>> data, consumed =3D self.encode(object, self.errors) +>> UnicodeEncodeError: 'ascii' codec can't encode character u'\u017b' in +>> position 176: ordinal not in range(128) +> +> Hmm. __future__'s unicode_literals should be giving us a Unicode +> target, so I'm not sure why we'd have trouble injecting Unicode. This +> works fine for me on Python 2.7 and 3.3. Maybe you just have a funky +> encoding? What is your: +> +> $ locale +> LANG=3Den_US.UTF-8 +> =E2=80=A6 +> $ python -c 'import locale, sys; print(locale.getpreferredencoding() or= + sys.getdefaultencoding())' +> UTF-8 + +LANG=3Den_US.UTF-8 +all other LC_* variables en_US.UTF-8 except +LC_TIME=3Den_GB.utf8 +LC_ALL empty (naturally) + +python -c 'import locale; print(locale.getpreferredencoding())' +UTF-8 +python -c 'import sys; print(sys.getdefaultencoding())' +ascii + + +anyway, if this doesn't resolve out and there is no resistance to require +python 2.7 (that means from David) I can hack around this to get this +reviewed. + +> +> Cheers, +> Trevor + +Tomi + +> +> [1]: http://www.python.org/download/releases/2.6.9/ -- 2.26.2