Lee Harr <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> On 2005-04-07, foten <[EMAIL PROTECTED]> wrote:
> > The problem I'm having is when I'm trying to extract the
> > attachement using
> > f=open(Filename, "wb")
> > f.write(msg.get_payload(decode=1))
> > f.close()
> > Not the whole message is decoded and stored!
> > When only trying
> > f.write(msg.get_payload())
> > I see that the last 255 bytes are missing.
> >
>
>
> What happens if you do...
>
> m = msg.get_payload(decode=1)
> f.write(m)
> f.write(m)
> f.close()
> ?
>
> Just wondering if maybe some buffer not
> being flushed properly.
>
> Maybe could replace the 2nd f.write()
> with an f.flush()
Lee Harr <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> On 2005-04-07, foten <[EMAIL PROTECTED]> wrote:
> > The problem I'm having is when I'm trying to extract the
> > attachement using
> > f=open(Filename, "wb")
> > f.write(msg.get_payload(decode=1))
> > f.close()
> > Not the whole message is decoded and stored!
> > When only trying
> > f.write(msg.get_payload())
> > I see that the last 255 bytes are missing.
> >
>
>
> What happens if you do...
>
> m = msg.get_payload(decode=1)
> f.write(m)
> f.write(m)
> f.close()
> ?
>
> Just wondering if maybe some buffer not
> being flushed properly.
>
> Maybe could replace the 2nd f.write()
> with an f.flush()
Thanx for the ideas!
If I do
f.write(m)
f.write(m)
nothing is changed. After the first write I'm missing 255 bytes and the
second write just doubles the data. After this I'm missing 510 bytes.
Doing a flush doesn't help either, if I'm not misstaken, calling close()
on a file inplicitly calls flush().
get_payload() fails to deliver the correct amount of data, in this case ~82k...
This drives my crazy!
--
http://mail.python.org/mailman/listinfo/python-list