Convert buffer(...) -> bytes(...) for Python 3 compatibility.