This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: rfc2231 line continuations result in an additional newline
Type: behavior Stage: resolved
Components: email Versions: Python 2.7
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: Brian Peterson, barry, r.david.murray, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2015-03-20 21:38 by Brian Peterson, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg238725 - (view) Author: Brian Peterson (Brian Peterson) Date: 2015-03-20 21:38

So here we go:

When an email header goes over a line break, rfc2231 ( specifies that it get formatted in such a way that the line break is stripped out. This formatting looks like, for example:

> filename*0="my long attachment"
> filename*1="name.txt"

... which should then get interpreted so that is "semantically identical" to:

> filename="my long attachment name.txt"

Here's a link to an example github repo where I see this not occurring:

More specifically, the behavior I AM seeing is that the formatting is handled just fine, but that a newline character gets added in.

(I originally thought this had to do with the requests library, so that's why my example repo has some stuff related to that in there too, which you can safely ignore.)

Also, if I am off-base, possibly if my input email's formatting is to blame, sorry for the trouble. :-)

Thanks for reading!
msg238760 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-03-21 04:27
Can you provide an example email in a simple reproducer script?
msg240677 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-04-13 17:35
I can't reproduce this and no example is forthcoming, so I'm closing this as works for me.
Date User Action Args
2022-04-11 14:58:14adminsetgithub: 67915
2015-04-13 17:35:37r.david.murraysetstatus: open -> closed
resolution: works for me
messages: + msg240677

stage: resolved
2015-03-21 04:39:49steve.dowersetnosy: - steve.dower
2015-03-21 04:27:12r.david.murraysetmessages: + msg238760
2015-03-20 22:21:34eric.smithsetnosy: + r.david.murray, barry
components: + email, - Windows
2015-03-20 21:38:06Brian Petersoncreate