fix encoding problems; remove python2 support