[issue31089] email.utils.parseaddr fails on odd double quotes in multiline header

2017-08-01 Thread R. David Murray
R. David Murray added the comment: Yes, that is mostly likely why parseaddr operates the way it does. The old email package does not do very much hand-holding, it expects you to understand the RFCs, which as you note is a rather daunting task. The new email package (the new policies) in pyth

[issue31089] email.utils.parseaddr fails on odd double quotes in multiline header

2017-08-01 Thread Robert
Robert added the comment: RFC regarding this topic looks quite complicated to me, but I know that \r\n is used for line breaking in e-mail headers and \n is not. So in my opinion it shouldn't be treated the same like \n. The \r\n should be removed in parsed text, but \n should be preserved lik

[issue31089] email.utils.parseaddr fails on odd double quotes in multiline header

2017-07-31 Thread R. David Murray
R. David Murray added the comment: Ah, I take it back. With \n it retains the \n in the decoded name field. There is a bug of some sort here (\r\n should be treated the same as \n, I think, whatever way it is treated). I don't think this is worth addressing, given that the new policies provi

[issue31089] email.utils.parseaddr fails on odd double quotes in multiline header

2017-07-31 Thread R. David Murray
R. David Murray added the comment: parseaddr does what you expect if the message has been read using universal newline mode (ie: the linesep is \n): >>> parseaddr('"=?UTF-8?Q?Anita_=W4=86ieckli=C5=84ska_|_PATO_Nieruch?=\n >>> =?UTF-8?Q?omo=C5=9Bci?=" "') ('=?UTF-8?Q?Anita_=W4=86ieckli=C5=84ska

[issue31089] email.utils.parseaddr fails on odd double quotes in multiline header

2017-07-31 Thread Robert
Changes by Robert : -- components: +email nosy: +barry, r.david.murray type: -> behavior ___ Python tracker ___ ___ Python-bugs-list

[issue31089] email.utils.parseaddr fails on odd double quotes in multiline header

2017-07-31 Thread Robert
New submission from Robert: email.utils.parseaddr() does not successfully parse a field value into a (comment, address) pair if the FROM header has 2 lines (or more) containing odd number of double quotes in each of them. The address in such tuple is not e-mail address but a part of comment. F