Handle Python 3 bytes and str here