summaryrefslogtreecommitdiff
path: root/Lib/email/generator.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2009-03-30 22:42:17 +0000
committerBarry Warsaw <barry@python.org>2009-03-30 22:42:17 +0000
commitdbf95a3643ddad5909d815463f53bebd534f30cf (patch)
treebacd844dbb075ce5e76b44f4a2184a2259416269 /Lib/email/generator.py
parent55acfc6c87522b3242449cd77a0bf4f1c6cf962b (diff)
downloadcpython-git-dbf95a3643ddad5909d815463f53bebd534f30cf.tar.gz
A fix for issue 1974, inspired by the patch from Andi Albrecht (aalbrecht),
though with some changes by me. This patch should not be back ported or forward ported. It's a bit too risky for 2.6 and 3.x does things fairly differently.
Diffstat (limited to 'Lib/email/generator.py')
-rw-r--r--Lib/email/generator.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/email/generator.py b/Lib/email/generator.py
index ed832a3e9a..594a25783e 100644
--- a/Lib/email/generator.py
+++ b/Lib/email/generator.py
@@ -1,5 +1,4 @@
-# Copyright (C) 2001-2006 Python Software Foundation
-# Author: Barry Warsaw
+# Copyright (C) 2001-2009 Python Software Foundation
# Contact: email-sig@python.org
"""Classes to generate plain text from a message object tree."""
@@ -156,10 +155,13 @@ class Generator:
# be to not split the string and risk it being too long.
print >> self._fp, v
else:
- # Header's got lots of smarts, so use it.
+ # Header's got lots of smarts, so use it. Note that this is
+ # fundamentally broken though because we lose idempotency when
+ # the header string is continued with tabs. It will now be
+ # continued with spaces. This was reversedly broken before we
+ # fixed bug 1974. Either way, we lose.
print >> self._fp, Header(
- v, maxlinelen=self._maxheaderlen,
- header_name=h, continuation_ws='\t').encode()
+ v, maxlinelen=self._maxheaderlen, header_name=h).encode()
# A blank line always separates headers from body
print >> self._fp