Handle unicode -> str -> bytes rename in py3