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

Python "buffer" type in Message body should map to a known encoding type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • proton-0.14.0
    • proton-0.16.0
    • python-binding
    • None

    Description

      If I try to send a message like this it fails due to an encoding error.

      from proton import Message
      Message(body=buffer('asdf'))

      If you try to send this and fail to specify an encoding, you will get an encoding traceback like this one.

      Traceback (most recent call last):
      File "/usr/lib64/python2.7/threading.py", line 804, in __bootstrap_inner
      self.run()
      File "/home/vagrant/devel/kombu/kombu/transport/qpid.py", line 1367, in run
      Container(HelloWorld("localhost:5672", self._w, self.outbound_messages)).run()
      File "/usr/lib64/python2.7/site-packages/proton/reactor.py", line 133, in run
      while self.process(): pass
      File "/usr/lib64/python2.7/site-packages/proton/reactor.py", line 159, in process
      self._check_errors()
      File "/usr/lib64/python2.7/site-packages/proton/reactor.py", line 155, in _check_errors
      compat.raise(exc, value, tb)
      File "/usr/lib64/python2.7/site-packages/proton/_init_.py", line 4022, in dispatch
      ev.dispatch(self.handler)
      File "/usr/lib64/python2.7/site-packages/proton/_init_.py", line 3934, in dispatch
      self.dispatch(h, type)
      File "/usr/lib64/python2.7/site-packages/proton/_init_.py", line 3931, in dispatch
      result = dispatch(handler, type.method, self)
      File "/usr/lib64/python2.7/site-packages/proton/_init_.py", line 3812, in dispatch
      return m(*args)
      File "/usr/lib64/python2.7/site-packages/proton/handlers.py", line 40, in on_link_flow
      self.on_sendable(event)
      File "/usr/lib64/python2.7/site-packages/proton/handlers.py", line 62, in on_sendable
      dispatch(self.delegate, 'on_sendable', event)
      File "/usr/lib64/python2.7/site-packages/proton/_init_.py", line 3812, in dispatch
      return m(*args)
      File "/home/vagrant/devel/kombu/kombu/transport/qpid.py", line 1351, in on_sendable
      event.sender.send(message)
      File "/usr/lib64/python2.7/site-packages/proton/_init_.py", line 2997, in send
      return obj.send(self, tag=tag)
      File "/usr/lib64/python2.7/site-packages/proton/_init_.py", line 1116, in send
      encoded = self.encode()
      File "/usr/lib64/python2.7/site-packages/proton/_init_.py", line 1099, in encode
      self._pre_encode()
      File "/usr/lib64/python2.7/site-packages/proton/_init_.py", line 843, in _pre_encode
      body.put_object(self.body)
      File "/usr/lib64/python2.7/site-packages/proton/_init_.py", line 2271, in put_object
      putter(self, obj)
      File "/usr/lib64/python2.7/site-packages/proton/_init_.py", line 2114, in put_dict
      self.put_object(v)
      File "/usr/lib64/python2.7/site-packages/proton/_init_.py", line 2270, in put_object
      putter = self.put_mappings[obj.__class__]
      KeyError: <type 'buffer'>

      Attachments

        Issue Links

          Activity

            People

              aconway Alan Conway
              bmbouter Brian Bouterse
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: