This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Tim.Graham
Recipients Tim.Graham
Date 2016-08-11.13:51:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1470923464.88.0.417077764128.issue27737@psf.upfronthosting.co.za>
In-reply-to
Content
Python 2.7:
>>> from email.header import Header
>>> Header(' ').encode()
''

Python 3.2+ (I didn't check older versions of Python 3):
>>> Header(' ').encode()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/tim/code/cpython/Lib/email/header.py", line 391, in encode
    value = formatter._str(linesep)
  File "/home/tim/code/cpython/Lib/email/header.py", line 427, in _str
    self.newline()
  File "/home/tim/code/cpython/Lib/email/header.py", line 439, in newline
    self._lines[-1] += str(self._current_line)
IndexError: list index out of range

(Originally reported at https://code.djangoproject.com/ticket/27051)
History
Date User Action Args
2016-08-11 13:51:04Tim.Grahamsetrecipients: + Tim.Graham
2016-08-11 13:51:04Tim.Grahamsetmessageid: <1470923464.88.0.417077764128.issue27737@psf.upfronthosting.co.za>
2016-08-11 13:51:04Tim.Grahamlinkissue27737 messages
2016-08-11 13:51:04Tim.Grahamcreate