【发布时间】:2015-07-08 21:48:39
【问题描述】:
我正在使用 Python3 和 mime.multipart 发送附件。我能够成功发送附件。但是今天,当我在 WINSCP 中看到它明显存在时,我收到一个错误消息,说文件不存在。这是权限问题吗?此外,当我列出目录的内容时,文件不会显示。怎么回事?
【问题讨论】:
-
我将说明明显的检查:python 正在查找的目录已更改(检查),或者文件已移动(检查)
-
列出了同一文件夹中具有相同权限的其他文件,但不是我要附加的文件。粘贴一些调试语句: >>写入 /home/user/programs/automation/files/Acme_Insights.xslx >>在文件目录中..(glob.glob) ['/home/user/programs/automation/files/test. txt'](acme 没有列出)>>文件“process_insights_python.py”,第 885 行,在 main fp = open(fileToSend,“rb”) FileNotFoundError: [Errno 2] 没有这样的文件或目录:“/home/user /programs/automation/files/Acme_Insights.xslx"
标签: python python-3.x file-upload email-attachments mime-message