New submission from Enrique Perez-Terron <enri...@perezterron.net>: When address group is missing final ';', 'value' will be an empty string. I suggest the following patch
$ diff -u _save_header_value_parser.py _header_value_parser.py --- _save_header_value_parser.py 2018-03-14 01:07:54.000000000 +0100 +++ _header_value_parser.py 2018-05-13 02:17:13.830053600 +0200 @@ -1876,7 +1876,7 @@ if not value: group.defects.append(errors.InvalidHeaderDefect( "end of header in group")) - if value[0] != ';': + elif value[0] != ';': raise errors.HeaderParseError( "expected ';' at end of group but found {}".format(value)) group.append(ValueTerminal(';', 'group-terminator')) ---------- components: email messages: 316440 nosy: Cacadril, barry, r.david.murray priority: normal severity: normal status: open title: String index out of range in get_group(), email/_header_value_parser.py type: crash versions: Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33476> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com