diff options
author | Bruno ReniƩ <brutasse@gmail.com> | 2014-08-29 10:26:36 +0200 |
---|---|---|
committer | Mark Roberts <wizzat@fb.com> | 2014-09-03 09:55:45 -0700 |
commit | ab80fa8283dc938e354d094e34fb0e86b5316ea4 (patch) | |
tree | 1ad91b2301425f38d59a10d432dd4e46d94844f1 | |
parent | d6f08d31e233c5d297cbaa04750b145b8eb908f5 (diff) | |
download | kafka-python-ab80fa8283dc938e354d094e34fb0e86b5316ea4.tar.gz |
Bytes in self.msg()
-rw-r--r-- | kafka/producer.py | 2 | ||||
-rw-r--r-- | test/testutil.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/kafka/producer.py b/kafka/producer.py index fb83da6..687bb2d 100644 --- a/kafka/producer.py +++ b/kafka/producer.py @@ -180,7 +180,7 @@ class Producer(object): # Raise TypeError if any message is not encoded as bytes if any(not isinstance(m, six.binary_type) for m in msg): - raise TypeError("all produce message payloads must be type str") + raise TypeError("all produce message payloads must be type bytes") if self.async: for m in msg: diff --git a/test/testutil.py b/test/testutil.py index 7c8c802..114dff9 100644 --- a/test/testutil.py +++ b/test/testutil.py @@ -88,7 +88,7 @@ class KafkaIntegrationTestCase(unittest.TestCase): if s not in self._messages: self._messages[s] = '%s-%s-%s' % (s, self.id(), str(uuid.uuid4())) - return self._messages[s] + return self._messages[s].encode('utf-8') class Timer(object): def __enter__(self): |