我在我的代码中通过电子邮件发送执行日志,但解码失败,文件内容变为:
mg×£h¿m5ë]÷çMC<䓆ÛiÿývïM5ç]ô÷û²È¨Ÿÿ{míׇ6áþû÷W5åíÞ{¦šãnºç¯î®[«–m§ÿé‹›²Ö {V³º·°y»"µë'zßìzË"¢r÷¶ÞÑÝxsnï¿us^
我正在运行下一个代码:
def send_email(self):
email_filename = WebUIOrgResorces.logfilename
fp = codecs.open(email_filename, 'rb')
filecontent = fp.read()
encodedcontent = base64.b64encode(filecontent)