这是代码
import poplib
from email import parser
pop_conn = poplib.POP3_SSL('pop.gmail.com')
pop_conn.user('user@gmail.com')
pop_conn.pass_('password')
messages = [pop_conn.retr(i) for i in range(1, len(pop_conn.list()[1]) + 1)]
messages = ["\n".join(mssg[1]) for mssg in messages]
messages = [parser.Parser().parsestr(mssg) for mssg in messages]
for message in messages:
print(message)
当它到达第 8 行时 ( messages = ["\n".join(mssg[1]) for mssg in messages]
)
它是这样说的:
TypeError: sequence item 0: expected str instance, bytes found
有谁知道我做错了什么?