From f75a3c85093e88b1a21c054ca63cf934bf6a8bf0 Mon Sep 17 00:00:00 2001 From: Benoit Bayszczak Date: Wed, 1 Aug 2018 11:06:00 +0200 Subject: [PATCH] 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 --- gear/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'),