Dimitri John Ledkov <dimitri.led...@canonical.com> added the comment:

Yes, issue38698 covers the UnboundLocalError,

but doesn't cover inside get_msg_id there is also this gem:

    def get_msg_id(value):
        msg_id = MsgID()
        if value[0] in CFWS_LEADER:

It should test value before accessing value[0] like it is done in other places, 
ie.:

    if value and value[0] in CFWS_LEADER:

or indent the whole block to iterate over value with:

    while value:
        ...

which also tests that value has [0] index.

I guess I want to repurpose this issue for the value[0] indexerror in 
get_msg_id().

----------

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

Reply via email to