Re: parsing email from stdin

2013-10-08 Thread Andreas Perstinger
On 08.10.2013 17:25, Antoon Pardon wrote: Op 08-10-13 16:24, Andreas Perstinger schreef: Looking at the docs, I've found there is also "message_from_binary_file" which works for me with your code. http://docs.python.org/3/library/email.parser.html#email.message_from_binary_file I can't try t

Re: parsing email from stdin

2013-10-08 Thread Antoon Pardon
Op 08-10-13 16:24, Andreas Perstinger schreef: On 08.10.2013 14:20, Antoon Pardon wrote: As I don't know what encoding these messages will be in, I thought it would be prudent to read stdin as binary data. Using python 3.3 on a debian box I have the following code. #!/usr/bin/python3 import s

Re: parsing email from stdin

2013-10-08 Thread Andreas Perstinger
On 08.10.2013 14:20, Antoon Pardon wrote: As I don't know what encoding these messages will be in, I thought it would be prudent to read stdin as binary data. Using python 3.3 on a debian box I have the following code. #!/usr/bin/python3 import sys from email import message_from_file sys.stdi