R. David Murray <rdmur...@bitdance.com> added the comment:

More tests are always good :)

The "correct" solution here (as far as I remember, its has been a while since 
I've had time to even looked at the _header_value_parser code) would be to add 
a new 'invalid-msg-id' token, and do this:

    message_id = MessageID()
    try:
        token, value = get_msg_id(value)
        message_id.append(token)
    except HeaderParseError as ex:
        message_id = InvalidMessageID(value)
        message_id.defects.append(InvalidHeaderDefect(
            f"Invalid msg_id: {ex}"))
    return message_id

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38698>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to