Re: Some parsing/generation issues of email in Python 3
"R. David Murray" <[email protected]> Thu, 09 Jun 2016 16:00:18 -0400
| Newsgroups | gmane.comp.python.mime.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thu, 09 Jun 2016 18:37:54 +0200, Hans-Peter Jansen <[email protected]> wrote: > Apart from all considerations related to streaming/memory > consumption/assembly, IMHO the weakest spot of the email package is header > handling: the magic formula > > str(email.header.make_header(email.header.decode_header(msg['subject']))) > > for getting to the "real" subject string is, cough, improvable. > > Sure, this is complicated by the all the other modules, that are using > email.header as well. I can only remotely imagine, how hard this is going to > be in order to get this out of the SNAFU state.. That's exactly what the new policies like SMTP do, using all the new code I wrote. (That is, I did the hard work a couple years ago.) With the new policies, getting the "real" value of the header becomes: msg['subject'] Now we just have to work out the bugs in the new code :) Streaming and memory consumption have yet to be addressed. By the time that's done, there won't be much of the original code left outside of the compatibility mode :) --David