Skip to content

Conversation

@zackdever
Copy link
Collaborator

The docstring for get_messages states that None is a valid argument for timeout, but there's a small bug when splitting the timeout between partitions:

TypeError                                 Traceback (most recent call last)
<ipython-input-3-2ff994acfcef> in <module>()
----> 1 for message in consumer.get_messages(count=1, block=True, timeout=None):
      2     print message
      3

/Users/zack/repo/kafka-python/kafka/consumer.py in get_messages(self, count, block, timeout)
    295
    296         # HACK: This splits the timeout between available partitions
--> 297         timeout = timeout * 1.0 / len(self.offsets)
    298
    299         with FetchContext(self, block, timeout):

TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'

mumrah added a commit that referenced this pull request Dec 13, 2013
allow for timeout to be None in SimpleConsumer.get_messages
@mumrah mumrah merged commit a306687 into dpkp:master Dec 13, 2013
@mumrah
Copy link
Collaborator

mumrah commented Dec 13, 2013

Looks good, thanks @Zever!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants