Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-2563

local variable 'context' referenced before assignment

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • python-binding
    • None

    Description

      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 :

      event = Event(impl, number, clsname, context) 

      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?

      Attachments

        Activity

          People

            astitcher Andrew Stitcher
            danielmewes-ambient Daniel Mewes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: