Fix encoding errors in the python 3 tests