More Python 3 rework

Port to Python 3

Yet more fixes

whitespace

(0) -100 -30 -10 -4 +4 +10 tip

mercurial