From 9fd170e2d053bd86592b8728bdd00cf2d2a06d0b Mon Sep 17 00:00:00 2001 From: R David Murray Date: Wed, 14 Mar 2012 14:05:03 -0400 Subject: #14062: fix BytesParser handling of linesep for Header objects This also affected smtplib.SMTP.send_message, which calls BytesParser. --- Lib/email/generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/email/generator.py') diff --git a/Lib/email/generator.py b/Lib/email/generator.py index f0e7a95477..430ee73ea1 100644 --- a/Lib/email/generator.py +++ b/Lib/email/generator.py @@ -360,7 +360,7 @@ class BytesGenerator(Generator): for h, v in msg._headers: self.write('%s: ' % h) if isinstance(v, Header): - self.write(v.encode(maxlinelen=self._maxheaderlen)+NL) + self.write(v.encode(maxlinelen=self._maxheaderlen)+self._NL) elif _has_surrogates(v): # If we have raw 8bit data in a byte string, we have no idea # what the encoding is. There is no safe way to split this -- cgit v1.2.1