diff options
author | Dana Powers <dana.powers@gmail.com> | 2015-04-04 10:48:09 -0700 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2015-04-04 10:48:09 -0700 |
commit | 45c05d0f40ff686b026828621ba9ad8b5d21581d (patch) | |
tree | 69e8a5142d8946adddc44590612a9968540d801f /kafka/client.py | |
parent | 9fd08119170b64c56ea024d12ef6b0e6482d778b (diff) | |
parent | 1c856e8400e1c4fe6dccd562fbcf4d1bde38755d (diff) | |
download | kafka-python-45c05d0f40ff686b026828621ba9ad8b5d21581d.tar.gz |
Merge pull request #361 from kecaps/master
Make external API consistently support python3 strings for topic.
Diffstat (limited to 'kafka/client.py')
-rw-r--r-- | kafka/client.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kafka/client.py b/kafka/client.py index c36cd08..4cd9e24 100644 --- a/kafka/client.py +++ b/kafka/client.py @@ -258,12 +258,14 @@ class KafkaClient(object): self.topic_partitions.clear() def has_metadata_for_topic(self, topic): + topic = kafka_bytestring(topic) return ( topic in self.topic_partitions and len(self.topic_partitions[topic]) > 0 ) def get_partition_ids_for_topic(self, topic): + topic = kafka_bytestring(topic) if topic not in self.topic_partitions: return [] @@ -312,6 +314,7 @@ class KafkaClient(object): Partition-level errors will also not be raised here (a single partition w/o a leader, for example) """ + topics = [kafka_bytestring(t) for t in topics] resp = self.send_metadata_request(topics) log.debug("Broker metadata: %s", resp.brokers) |