今天在用Python写一个发带有附件的邮件时,发现程序总是出错,仔细看看,是提示在email/quopriMIME.py的第79行提示:
File "C:/Python24/lib/email/quopriMIME.py", line 79, in _max_append
L.append(s.lstrip())
AttributeError: 'tuple' object has no attribute 'lstrip'
tuple当然是没有lstrip函数了,看来是类型判断错误!改为:
L.append(str(s).lstrip())
后一切正常!