Python3

I ran the code through 2to3, made it work with python 3.4.0, then made it work on 2.7.8 again.

caveat: I assumed a UTF-8 locale, which is probably not right.

PEP 3101: note that support for the ``str.format()`` method has been backported to Python 2.6, so it shouldn't present a problem on any modern system.