Skip to content

TypeError: '<' not supported between instances of 'int' and 'tuple' #1276

Closed
@rbrunhuber

Description

@rbrunhuber

I'm using the current version of master (commit a345dcd) and I'm seeing the following exception.

Environment:
•Kafka 0.10.0.2.6
•Kerberos 5 version 1.12.2 (MS AD server)
•Python 3.6.1 |Anaconda 4.4.0 (64-bit)
•kafka-python (1.3.6.dev0)
•gssapi (1.2.2)

Traceback (most recent call last):
  File "/home/myname/workspace/python/kafkatest/kafkatest.py", line 20, in <module>
    ,auto_offset_reset='earliest'
  File "/opt/continuum/anaconda3/lib/python3.6/site-packages/kafka/consumer/group.py", line 327, in __init__
    self._client = KafkaClient(metrics=self._metrics, **self.config)
  File "/opt/continuum/anaconda3/lib/python3.6/site-packages/kafka/client_async.py", line 225, in __init__
    self._bootstrap(collect_hosts(self.config['bootstrap_servers']))
  File "/opt/continuum/anaconda3/lib/python3.6/site-packages/kafka/client_async.py", line 259, in _bootstrap
    bootstrap.connect()
  File "/opt/continuum/anaconda3/lib/python3.6/site-packages/kafka/conn.py", line 384, in connect
    if self._try_authenticate():
  File "/opt/continuum/anaconda3/lib/python3.6/site-packages/kafka/conn.py", line 468, in _try_authenticate
    raise ex  # pylint: disable-msg=raising-bad-type
  File "/opt/continuum/anaconda3/lib/python3.6/site-packages/kafka/conn.py", line 580, in _try_authenticate_gssapi
    received_token = self._recv_bytes_blocking(token_size)
  File "/opt/continuum/anaconda3/lib/python3.6/site-packages/kafka/conn.py", line 510, in _recv_bytes_blocking
    while len(data) < n:
TypeError: '<' not supported between instances of 'int' and 'tuple'

According to the other usages of "unpack" I "naively" fixed this problem by changing the function "_try_authenticate_gssapi" in "conn.py" according to the following diff:

575c575
<                     token_size = struct.unpack('>i', header)
---
>                     token_size = struct.unpack('>i', header)[0]

I don't know if this only fails for me or my version of python but without the fix I could not continue to test this library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions