mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
#14062: fix BytesParser handling of linesep for Header objects
This also affected smtplib.SMTP.send_message, which calls BytesParser.
This commit is contained in:
parent
525fd5447d
commit
9fd170e2d0
3 changed files with 28 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue