py3: use pycompat.bytestr() instead of str()

Authored by pulkit.