You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Brian Bouterse (JIRA)" <ji...@apache.org> on 2016/10/12 19:36:20 UTC

[jira] [Created] (PROTON-1325) Python "buffer" type in Message body should map to AMQP bytes[] encoding

Brian Bouterse created PROTON-1325:
--------------------------------------

             Summary: Python "buffer" type in Message body should map to AMQP bytes[] encoding
                 Key: PROTON-1325
                 URL: https://issues.apache.org/jira/browse/PROTON-1325
             Project: Qpid Proton
          Issue Type: Bug
          Components: python-binding
    Affects Versions: 0.14.0
            Reporter: Brian Bouterse


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'>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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