socket.sendall requires bytes as input on Python 3+.