【发布时间】:2018-02-01 23:25:19
【问题描述】:
我正在使用此脚本从收件箱中删除邮件。
if(not debug):
logging.debug("removing messages")
all_mail.lock()
for message in all_mail:
all_mail.remove(message)
all_mail.flush()
all_mail.unlock()
all_mail.close()
运行此脚本一次后,我注意到/var/spool/mail 中仍有一个锁定文件。如果我再次尝试运行脚本,我会得到一个相当可预测的异常:mailbox.ExternalClashError: dot lock unavailable
所以似乎 all_mail.unlock() 不起作用,但我不确定还能做什么。
【问题讨论】: