Python 3 compatibility.
Fixed stdlib test runner.
Merge branch 'python3' into release-1.2.0