Stefan Ram <r...@zedat.fu-berlin.de> wrote: > Chris Green <c...@isbd.net> writes: > > chris@cheddar$ tail mail.err > > Traceback (most recent call last): > > File "/home/chris/.mutt/bin/filter.py", line 95, in <module> > > if sbstrip in msghdr["subject"]: > > TypeError: argument of type 'Header' is not iterable > >But msghdr["subject"] is surely just a string isn't it? Why is it > >complaining about something of type 'Header'? > > I presume that the error message has been edited (abbreviated). > > In "if sbstrip in msghdr["subject"]:", there is no argument. > > But the error message says "argument of ...". > > When something that is not iterable is presented to a for loop, > the error message does not mention "argument": > I have output everything that appears, I've not changed it at all. It's the whole content of the file ~/tmp/mail.err as it's the only error that has occurred for the last day or so. The error log is created by the line:-
sys.stderr = open("/home/chris/tmp/mail.err", 'a') So that's everything that was output to stderr. I think you are puzzled in the same way that I was, the error message doesn't make a lot of sense. > |>>> for i in 0: > |... print(i) > |... > |Traceback (most recent call last): > | File "<stdin>", line 1, in <module> > |TypeError: 'int' object is not iterable > > . > > -- Chris Green ยท -- https://mail.python.org/mailman/listinfo/python-list