Merge #11401 fix from 3.1.

This commit is contained in:
R David Murray 2011-03-16 18:27:34 -04:00
commit 4e4326829f
3 changed files with 11 additions and 1 deletions

View file

@ -314,7 +314,7 @@ class Header:
self._continuation_ws, splitchars)
for string, charset in self._chunks:
lines = string.splitlines()
formatter.feed(lines[0], charset)
formatter.feed(lines[0] if lines else '', charset)
for line in lines[1:]:
formatter.newline()
if charset.header_encoding is not None: