Python 3+ syntax

* except E, e -> except E as e
* 0ddd -> 0oddd
* print -> print()

(These are required syntactical fixes only; other changes
are needed to make this code run in Python 3.)
Convert old '%'-formatting syntax to str.format()

The old syntax is deprecated in Python 3.
Python 3+ strings are unicode strings.

* Remove unicode() calls
* Do not encode strings before formatting.
Running 2to3 conversion tool on the code.

(Actually the remainder of rebasing the 2to3 patch
onto the earlier, manual syntax fixes.)