类型错误:强制使用Unicode:需要字符串或缓冲区,找到列表

2024-09-24 22:24:35 发布

您现在位置:Python中文网/ 问答频道 /正文

这是我在执行代码时遇到的错误有人能解释一下这意味着什么吗???拜托!!我对python还不熟悉,在一个类项目中使用它只有几个星期,但发现自己迷失了方向。

  File "C:/Documents and Settings/xyz/Desktop/FinalPayload", line 62, in <module>
    mail("jt.kennings@gmail.com","python test","payload from python test",results)

  File "C:/Documents and Settings/xyz/Desktop/FinalPayload", line 42, in mail
    part.set_payload(open(attach, 'rb').read())
TypeError: coercing to Unicode: need string or buffer, list found

Tags: and项目代码intestsettings错误line