Bug 613648 - Python API crashes when it handles messages with content-type "text/plain" and empty content
Python API crashes when it handles messages with content-type "text/plain" an...
Status: CLOSED DUPLICATE of bug 613647
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-qpid (Show other bugs)
6.0
All Linux
high Severity medium
: rc
: ---
Assigned To: Rafael H. Schloming
MRG Quality Engineering
:
Depends On: 613216
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-12 09:55 EDT by Ted Ross
Modified: 2010-07-12 09:59 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 613216
Environment:
Last Closed: 2010-07-12 09:59:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ted Ross 2010-07-12 09:55:06 EDT
+++ This bug was initially created as a clone of Bug #613216 +++

Description of problem:

The Python API can't send or receive a message with content-type "text/plain" if the content length is zero.

Version-Release number of selected component (if applicable):

MRG1.3 beta4

How reproducible:

100%

Steps to Reproduce:

Use the following Python script:

>>> from qpid.messaging import Connection,Message
>>> conn = Connection("localhost")
>>> conn.open()
>>> sess = conn.session()
>>> xmt = sess.sender("amq.direct/key")
>>> m = Message()
>>> m.content_type = "text/plain"
>>> xmt.send(m)
  
Actual results:

Stack trace:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 6, in send
  File "/home/ross/svn5/qpid/python/qpid/messaging/endpoints.py", line 858, in send
    self.sync()
  File "<string>", line 6, in sync
  File "/home/ross/svn5/qpid/python/qpid/messaging/endpoints.py", line 869, in sync
    if not self._ewait(lambda: self.acked >= mno, timeout=timeout):
  File "/home/ross/svn5/qpid/python/qpid/messaging/endpoints.py", line 783, in _ewait
    result = self.session._ewait(lambda: self.error or predicate(), timeout)
  File "/home/ross/svn5/qpid/python/qpid/messaging/endpoints.py", line 550, in _ewait
    result = self.connection._ewait(lambda: self.error or predicate(), timeout)
  File "/home/ross/svn5/qpid/python/qpid/messaging/endpoints.py", line 194, in _ewait
    self.check_error()
  File "/home/ross/svn5/qpid/python/qpid/messaging/endpoints.py", line 187, in check_error
    raise self.error
qpid.messaging.exceptions.InternalError: Traceback (most recent call last):
  File "/home/ross/svn5/qpid/python/qpid/messaging/driver.py", line 468, in dispatch
    self.engine.dispatch()
  File "/home/ross/svn5/qpid/python/qpid/messaging/driver.py", line 757, in dispatch
    self.process(ssn)
  File "/home/ross/svn5/qpid/python/qpid/messaging/driver.py", line 977, in process
    self.send(snd, msg)
  File "/home/ross/svn5/qpid/python/qpid/messaging/driver.py", line 1188, in send
    body = enc(msg.content)
  File "/home/ross/svn5/qpid/python/qpid/messaging/message.py", line 56, in <lambda>
    "text/plain": (lambda x: x.encode("utf8"), lambda x: x.decode("utf8")),
AttributeError: 'NoneType' object has no attribute 'encode'


Expected results:

message sent
Comment 1 Ted Ross 2010-07-12 09:59:01 EDT

*** This bug has been marked as a duplicate of bug 613647 ***

Note You need to log in before you can comment on or make changes to this bug.