Basilisk96 wrote:
> >
> > Could the file like object still be encoded in MIME or something?
> >
>
> Yes it is. You don't need to seek(0).
> Try this:
>
> decoded = email.base64mime.decode(part.get_payload())
> fileObj.write(decoded)
Or better:
decoded = part.get_payload(decode=True)
fileObj.write
Basilisk96 wrote:
> >
> > Could the file like object still be encoded in MIME or something?
> >
>
> Yes it is. You don't need to seek(0).
> Try this:
>
> decoded = email.base64mime.decode(part.get_payload())
> fileObj.write(decoded)
>
>
> -Basilisk96
--
http://mail.python.org/mailman/listinfo/py
>
> Could the file like object still be encoded in MIME or something?
>
Yes it is. You don't need to seek(0).
Try this:
decoded = email.base64mime.decode(part.get_payload())
fileObj.write(decoded)
-Basilisk96
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 6, 12:51 am, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> erikcw wrote:
> > resp = p.retr(msg_num)
> > if resp[0].startswith('+OK'):
>
> You don't have to check this; errors are transformed into exceptions.
>
> > fileObj = StringIO.StringIO()
>
> cStri
erikcw wrote:
> resp = p.retr(msg_num)
> if resp[0].startswith('+OK'):
You don't have to check this; errors are transformed into exceptions.
> fileObj = StringIO.StringIO()
cStringIO is faster
> fileObj.write( part.get_payload() )
You
On Apr 5, 8:00 pm, hlubenow <[EMAIL PROTECTED]> wrote:
> erikcw wrote:
> > Hi all,
>
> > I'm trying to extract zip file (containing an xml file) from an email
> > so I can process it. But I'm running up against some brick walls.
> > I've been googling and reading all afternoon, and can't seem to f
erikcw wrote:
> Hi all,
>
> I'm trying to extract zip file (containing an xml file) from an email
> so I can process it. But I'm running up against some brick walls.
> I've been googling and reading all afternoon, and can't seem to figure
> it out.
>
> Here is what I have so far.
>
> p = POP3(
Hi all,
I'm trying to extract zip file (containing an xml file) from an email
so I can process it. But I'm running up against some brick walls.
I've been googling and reading all afternoon, and can't seem to figure
it out.
Here is what I have so far.
p = POP3("mail.server.com")
print p.getwelco