summaryrefslogtreecommitdiff
path: root/kafka/conn.py
diff options
context:
space:
mode:
authorChristophe Lecointe <christophe.lecointe@tuta.io>2018-01-24 20:26:22 +0100
committerDana Powers <dana.powers@gmail.com>2018-01-24 11:26:22 -0800
commit351f418ba5b62c28c8cff5ea7dcca8e37cadcf8e (patch)
tree49ba8b81d015d9106fa9ed39860dfc30414f6f80 /kafka/conn.py
parentbfa6e2044ad7ecef8ab042d43e2c4d47467d3949 (diff)
downloadkafka-python-351f418ba5b62c28c8cff5ea7dcca8e37cadcf8e.tar.gz
Fix for Python 3 byte string handling in SASL auth (#1353)
Diffstat (limited to 'kafka/conn.py')
-rw-r--r--kafka/conn.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/kafka/conn.py b/kafka/conn.py
index f30d987..5ff27d5 100644
--- a/kafka/conn.py
+++ b/kafka/conn.py
@@ -566,9 +566,9 @@ class BrokerConnection(object):
# Kafka currently doesn't support integrity or confidentiality security layers, so we
# simply set QoP to 'auth' only (first octet). We reuse the max message size proposed
# by the server
- msg = Int8.encode(SASL_QOP_AUTH & Int8.decode(io.BytesIO(msg[0]))) + msg[1:]
+ msg = Int8.encode(SASL_QOP_AUTH & Int8.decode(io.BytesIO(msg[0:1]))) + msg[1:]
# add authorization identity to the response, GSS-wrap and send it
- msg = client_ctx.wrap(msg + auth_id, False).message
+ msg = client_ctx.wrap(msg + auth_id.encode(), False).message
size = Int32.encode(len(msg))
self._send_bytes_blocking(size + msg)