Python 3 base64.encodestring expects a bytestr