fix Base64 encoding error on Python 3