[
https://issues.apache.org/jira/browse/PROTON-2563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17565381#comment-17565381
]
Andrew Stitcher commented on PROTON-2563:
-----------------------------------------
Yep that looks like a clear bug - My guess is that we've never encountered the
case where pn_event_class returns false before!
> 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
> Assignee: Andrew Stitcher
> Priority: Major
>
> 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.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]