I need some help interpreting this error

2QdxY4RzWzUUiLuE at potatochowder.com 2QdxY4RzWzUUiLuE at potatochowder.com
Wed Feb 17 11:03:32 EST 2021


On 2021-02-17 at 15:40:27 +0000,
Chris Green <cl at isbd.net> wrote:

> I'm running this using Python 3.7 on a Linux system.
> 
> Most of the time (i.e. for a couple of days now) the program has been
> satifactorily delivering mail messages, hundreds of them.  However one
> mail message has provoked the following error:-
> 
>     chris at 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'?

Isn't it?  ;-)

First step:  Print msghdr["subject"] and its type to know for sure.  The
worst case is that you'll verify your assumption.

IIRC, the subject header is actually optional.  Maybe someone sent a
message without a subject?  Is msghdr["subject"] None?


More information about the Python-list mailing list