Further Python 3 updates
Some additional Python 3 updates:
- Fix up a few places where there is a mixture of tabs and spaces in the Python modules.
- Fix up a remaining place where string exceptions were used
(I'd love to just run black over this code base to normalise the formatting from the mixture of different old formats…)