Re: [PATCH 00/17] nmbug-status: Python-3-compabitility and general refactoring

Subject: Re: [PATCH 00/17] nmbug-status: Python-3-compabitility and general refactoring

Date: Mon, 3 Feb 2014 16:53:32 -0800

To: Tomi Ollila


From: W. Trevor King

On Mon, Feb 03, 2014 at 11:10:23PM +0200, Tomi Ollila wrote:
>     data['message-id-term'] = '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.

>   File "devel/nmbug/nmbug-status", line 197, in _write_threads
>     ).format(**message_display_data))
>   File "/usr/lib64/python2.6/", line 351, in write
>     data, consumed = 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
  $ python -c 'import locale, sys; print(locale.getpreferredencoding() or sys.getdefaultencoding())'



This email may be signed or encrypted with GnuPG (
For more information, see
signature.asc (application/pgp-signature)