Handle python 3 bytes