【发布时间】:2017-12-05 04:35:33
【问题描述】:
这项工作:
mybot.sendDocument(chat_id=chatid, document=open('bla.pdf', rb'))
但如果我以前这样做过:
with open('bla.pdf', 'rb') as fp:
b = fp.read()
我做不到:
mybot.sendDocument(chat_id=chatid, document=b)
错误是:
TypeError: 'bytes' 类型的对象不是 JSON 可序列化的
我使用 python 3.5.2 win 或 linux
感谢回答
【问题讨论】: