You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Daniel Mewes (Jira)" <ji...@apache.org> on 2022/06/14 17:54:00 UTC

[jira] [Created] (PROTON-2563) local variable 'context' referenced before assignment

Daniel Mewes created PROTON-2563:
------------------------------------

             Summary: local variable 'context' referenced before assignment
                 Key: PROTON-2563
                 URL: https://issues.apache.org/jira/browse/PROTON-2563
             Project: Qpid Proton
          Issue Type: Bug
          Components: python-binding
            Reporter: Daniel Mewes


We're intermittently getting the following Python exception from qpid-proton:

UnboundLocalError: local variable 'context' referenced before assignment

The exception is raised in this line [https://github.com/apache/qpid-proton/blob/0.37.0/python/proton/_events.py#L419] :
{code:java}
event = Event(impl, number, clsname, context) {code}
Looking at that code, there appears to be a clear bug in that the `context` local variable is only set in the `if cls` branch, but not in the `else` branch above.

Presumably, context should at least be set to `None` in the else branch to avoid this exception?



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org