summaryrefslogtreecommitdiffstats
path: root/Lib/email
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2014-02-08 22:54:56 (GMT)
committerR David Murray <rdmurray@bitdance.com>2014-02-08 22:54:56 (GMT)
commite9c31470e1680b7c9b9ee83c378b891e90ac58ab (patch)
treea70d2c26d0f9bac95a0cab4bd74d93fc7ef3a35c /Lib/email
parent409ea5dac1bc9fb408b7ae27c57132dec5a7f9b6 (diff)
downloadcpython-e9c31470e1680b7c9b9ee83c378b891e90ac58ab.zip
cpython-e9c31470e1680b7c9b9ee83c378b891e90ac58ab.tar.gz
cpython-e9c31470e1680b7c9b9ee83c378b891e90ac58ab.tar.bz2
#14983: always add a line end after a MIME boundary marker.
This is more RFC compliant (see issue) and fixes a problem with signature verifiers rejecting the part when signed. There is some amount of backward compatibility concern here since it changes the output, but the RFC issue coupled with fixing the problem with signature verifiers seems worth the small risk of breaking code that depends on the current incorrect output.
Diffstat (limited to 'Lib/email')
-rw-r--r--Lib/email/generator.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/email/generator.py b/Lib/email/generator.py
index 07a97c7..e4a86d4 100644
--- a/Lib/email/generator.py
+++ b/Lib/email/generator.py
@@ -299,9 +299,8 @@ class Generator:
# body-part
self._fp.write(body_part)
# close-delimiter transport-padding
- self.write(self._NL + '--' + boundary + '--')
+ self.write(self._NL + '--' + boundary + '--' + self._NL)
if msg.epilogue is not None:
- self.write(self._NL)
if self._mangle_from_:
epilogue = fcre.sub('>From ', msg.epilogue)
else: