Program not Stripping Headers from Email though Working fine
dont bother
dontbotherworld at yahoo.com
Fri Mar 5 01:33:04 EST 2004
when I change the code to msg.as_string() to
msg.get_payload() I get this error:
user at localhost codes]$ python email2.py
Traceback (most recent call last):
File "email2.py", line 36, in ?
fwrite.write(msg.get_payload())
TypeError: argument 1 must be string or read-only
character buffer, not list
How to fix this? The first argument must not be list.
My first argument is a file containing many email
messages.
Thanks,
Dont
--- Gerrit <gerrit at nl.linux.org> wrote:
> dont bother wrote:
> > The code is here, but I dont know why the headers
> are
> > still present in the output file.
>
> > fwrite.write(msg.as_string())
> ~~~~~~~~~~~~~~~
>
> The as_string header returns both the headers and
> the body. You want
> something like get_payload()
>
> Gerrit.
>
> --
> Weather in Twenthe, Netherlands 04/03 14:55 UTC:
> 7.0°C haze mostly clear wind 4.5 m/s E (57 m above
> NAP)
> --
> Asperger's Syndrome - a personal approach:
> http://people.nl.linux.org/~gerrit/english/
__________________________________
Do you Yahoo!?
Yahoo! Search - Find what youre looking for faster
http://search.yahoo.com
More information about the Python-list
mailing list