Explicitly convert potential bytearrays to str

Tests on python 2 & 3