Apply lib2to3.fixes.fix_except
Apply lib2to3.fixes.fix_numliterals
Change relative imports to absolute.
Apply lib2to3.fixes.fix_apply
Apply some lib2to3.fixes.fix_idioms (exclued list(x).sort() -> sorted(x) changes.)
Apply lib2to3.fixes.tuple_params, and provied sensible names and docs.
Apply lib2to3.fixes.print
Use range instead of xrange, and list(range()).

Only do this for tests, as there a potential performance hit.
Use key functions rather than cmp functions.
Use collections.MutableMapping instead of UserDict.DictMixin
Use io.BytesIO rather than cStringIO.
Use email.parser rather than rfc822.
Use next(iter) instead of iter.next()
Merge branch 'python3' of git://github.com/garyvdm/dulwich