运行此代码以阅读电子邮件:
if uid > uid_max:
result, data = server.uid('fetch', uid, '(RFC822)') # fetch entire message
msg = email.message_from_string(data[0][1])
我收到此错误:
TypeError: can't concat int to bytes
该如何解决?
答案 0 :(得分:0)
我遇到了同样的问题,我将 uid 替换为 str(uid)
result, data = server.uid('fetch', str(uid), '(RFC822)')
再见