Uploaded image for project: 'AMQ Clients'
  1. AMQ Clients
  2. ENTMQCL-1075

[python] Example broker.py is using collections.deque.count from Python 2.7

XMLWordPrintable

    • Hide
      • Run example broker.py in the background
      • Run example simple_send.py to send messages
        • everything is OK
      • Run example simple_recv.py to receive messages
        • receiver ends without error
        • broker ends with exception:
      Traceback (most recent call last):
        File "./broker.py", line 123, in <module>
          Container(Broker(opts.address)).run()
        File "/usr/lib/python2.6/site-packages/proton/_reactor.py", line 180, in run
          while self.process(): pass
        File "/usr/lib/python2.6/site-packages/proton/_reactor.py", line 206, in process
          self._check_errors()
        File "/usr/lib/python2.6/site-packages/proton/_reactor.py", line 202, in _check_errors
          _compat.raise_(exc, value, tb)
        File "/usr/lib/python2.6/site-packages/proton/_reactor_impl.py", line 133, in dispatch
          ev.dispatch(self.handler)
        File "/usr/lib/python2.6/site-packages/proton/_events.py", line 254, in dispatch
          self.dispatch(h, type)
        File "/usr/lib/python2.6/site-packages/proton/_events.py", line 251, in dispatch
          result = _dispatch(handler, type.method, self)
        File "/usr/lib/python2.6/site-packages/proton/_events.py", line 113, in _dispatch
          return m(*args)
        File "/usr/lib/python2.6/site-packages/proton/_handlers.py", line 270, in on_link_remote_close
          self.on_link_closing(event)
        File "/usr/lib/python2.6/site-packages/proton/_handlers.py", line 398, in on_link_closing
          _dispatch(self.delegate, 'on_link_closing', event)
        File "/usr/lib/python2.6/site-packages/proton/_events.py", line 113, in _dispatch
          return m(*args)
        File "./broker.py", line 96, in on_link_closing
          self._unsubscribe(event.link)
        File "./broker.py", line 91, in _unsubscribe
          if link.source.address in self.queues and self.queues[link.source.address].unsubscribe(link):
        File "./broker.py", line 38, in unsubscribe
          return len(self.consumers) == 0 and (self.dynamic or self.queue.count == 0)
      AttributeError: 'collections.deque' object has no attribute 'count'
      
      Show
      Run example broker.py in the background Run example simple_send.py to send messages everything is OK Run example simple_recv.py to receive messages receiver ends without error broker ends with exception: Traceback (most recent call last): File "./broker.py" , line 123, in <module> Container(Broker(opts.address)).run() File "/usr/lib/python2.6/site-packages/proton/_reactor.py" , line 180, in run while self.process(): pass File "/usr/lib/python2.6/site-packages/proton/_reactor.py" , line 206, in process self._check_errors() File "/usr/lib/python2.6/site-packages/proton/_reactor.py" , line 202, in _check_errors _compat.raise_(exc, value, tb) File "/usr/lib/python2.6/site-packages/proton/_reactor_impl.py" , line 133, in dispatch ev.dispatch(self.handler) File "/usr/lib/python2.6/site-packages/proton/_events.py" , line 254, in dispatch self.dispatch(h, type) File "/usr/lib/python2.6/site-packages/proton/_events.py" , line 251, in dispatch result = _dispatch(handler, type.method, self) File "/usr/lib/python2.6/site-packages/proton/_events.py" , line 113, in _dispatch return m(*args) File "/usr/lib/python2.6/site-packages/proton/_handlers.py" , line 270, in on_link_remote_close self.on_link_closing(event) File "/usr/lib/python2.6/site-packages/proton/_handlers.py" , line 398, in on_link_closing _dispatch(self.delegate, 'on_link_closing' , event) File "/usr/lib/python2.6/site-packages/proton/_events.py" , line 113, in _dispatch return m(*args) File "./broker.py" , line 96, in on_link_closing self._unsubscribe(event.link) File "./broker.py" , line 91, in _unsubscribe if link.source.address in self.queues and self.queues[link.source.address].unsubscribe(link): File "./broker.py" , line 38, in unsubscribe return len(self.consumers) == 0 and (self.dynamic or self.queue.count == 0) AttributeError: 'collections.deque' object has no attribute 'count'
    • Yorba, Anza

      Example broker.py is using collections.deque.count which is not in Python 2.6.6, it is new in Python 2.7, see docs.

            jross@redhat.com Justin Ross
            rkubis_kafka_devexp Radim Kubis
            Radim Kubis Radim Kubis
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: