From looking briefly it seems that these are sensible changes, but many of them aren't necessary for Python 3 compatility. I suggest separating the Python 3 compatibility changes and other cleanups into different patches.
@michaelplatings : some of the non trivial changes are just here to make it easier to write the compatible code. e.g.
for f in range(len(dbg_line_items)): fname = dbg_line_items[f] fset = dbg_line_items[f]
forces dbg_line_items to be a list, while
for fname, fset in dbg_line_items:
is compatible with both list and generators