Use bytes() instead of str()

`bytes()` is more accurate and is actually correct in Python 3, whereas `str()` is incorrect in Python 3, because it's a Unicode string.

Cc: @Byron