TypeError: expected bytes-like object, not str

报错内容:TypeError: expected bytes-like object, not str

例:

a = base64.b64encode(temp)

改为:

a = base64.b64encode(bytes(temp, 'utf-8'))

问题解决!

posted @ 2018-09-05 16:54  小呆丶  阅读(2995)  评论(0编辑  收藏  举报