Vitaliyi wrote: > >I tried to feed 1.5Mb email message to Header(), it consumed about !Gb >of memory and them was killed: > >string = read('email_message').decode('utf-8') >decode_header(Header(string)) > [...] > >Could you please tell where to look to find a solution for this issue ?
Start with the documentation. The Header() constructor accepts a single header value, not an entire email message. the decode_header function also accepts a single header value, not a Header instance. You maybe want something like msg = email.message_from_file(open('email_message')) subj = msg['subject'] Then you could do things like email.header.Header(subj) to create a Header instance or decode_header(subj) to decode an RFC 2447 encoded subject. -- Mark Sapiro <m...@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan _______________________________________________ Email-SIG mailing list Email-SIG@python.org Your options: http://mail.python.org/mailman/options/email-sig/archive%40mail-archive.com