New submission from Tim Graham: 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) ---------- components: Library (Lib) files: whitespace-header-test.diff keywords: patch messages: 272447 nosy: Tim.Graham priority: normal severity: normal status: open title: email.header.Header.encode() crashes with IndexError on spaces only value versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file44077/whitespace-header-test.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27737> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com