Aug-27-2022, 08:54 PM
Quote:Somewhere in this line you are passing an argument to a function that is supposed to be a string, but is instead a mailbox object. I would split the line in half to find out which call failed.
x = mailbox.fetch(A(body='a@*.*')) print(x, type(x)) mailbox.delete(x)When you run this you'll find out out if the problem is with fetch() or delete().
So the issue is with
fetch()
?Is it a syntax issue with
'a@*.*'
?Output below:
Error:λ python DeleteEmailFiles.py
File "C:\Users\Desktop\Desktop\Python Spam Buster\DeleteEmailFiles.py", line 8
x = mailbox.fetch(A(body='a@*.*'))
^
IndentationError: expected an indented block after 'with' statement on line 4