py3 encoding fixes in tests