You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2019-05-23.01:17:21.594>created_at=<Date2016-08-11.13:51:04.796>labels= ['3.7', '3.8', 'type-bug', 'library']
title='email.header.Header.encode() crashes with IndexError on spaces only value'updated_at=<Date2019-05-23.01:41:47.667>user='https://github.com/timgraham'
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
New changeset 0416d6f by R. David Murray (Miss Islington (bot)) in branch '3.7': bpo-27737: Allow whitespace only headers encoding (GH-13478) (bpo-13517) 0416d6f
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: