summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bayszczak <benoit.bayszczak@schibsted.com>2018-08-01 11:06:00 +0200
committerBenoit Bayszczak <benoit.bayszczak@schibsted.com>2018-08-01 11:06:00 +0200
commitf75a3c85093e88b1a21c054ca63cf934bf6a8bf0 (patch)
tree1d412590a19198758e3596ae895d5c8d3e6d9d24
parentc00ca944db0d6dc6ef90859b0b9b7f3a58196fb0 (diff)
downloadgear-f75a3c85093e88b1a21c054ca63cf934bf6a8bf0.tar.gz
add missing str to bytes conversion for Python3
Using Python3, Gearman unexpectedly closed the socket with a client when typing the 'workers' command. gearman-debug.log: File "/usr/local/lib/python3.5/dist-packages/gear/__init__.py", line 3250, in handleWorkers (fd, ip, client_id.decode('utf8'), AttributeError: 'str' object has no attribute 'decode' Change-Id: I610bd44c76a0e52f8d4e8f24c82c636d4ebef0ae
-rw-r--r--gear/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/gear/__init__.py b/gear/__init__.py
index 4ed674e..b282ad3 100644
--- a/gear/__init__.py
+++ b/gear/__init__.py
@@ -3243,7 +3243,7 @@ class Server(BaseClientServer):
for connection in self.active_connections:
fd = connection.conn.fileno()
ip = connection.host
- client_id = connection.client_id or '-'
+ client_id = connection.client_id or b'-'
functions = b' '.join(connection.functions).decode('utf8')
request.connection.sendRaw(("%s %s %s : %s\n" %
(fd, ip, client_id.decode('utf8'),