Commit bf500dff authored by Nicolas Wavrant's avatar Nicolas Wavrant

equeue: use BytesIO instead of StringiO as buffer

as StringIO only accepts unicode, but socket.recv() returns a string
parent 099295af
......@@ -157,11 +157,12 @@ class EqueueServer(socketserver.ThreadingUnixStreamServer):
# Handle request
self.logger.debug("Connection with file descriptor %d", request.fileno())
request.settimeout(self.options.timeout)
request_string = io.StringIO()
segment = None
request_string = io.BytesIO()
try:
while segment != '':
while 1:
segment = request.recv(1024)
if not segment:
break
request_string.write(segment)
except socket.timeout:
pass
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment