equeue: use BytesIO instead of StringiO as buffer
as StringIO only accepts unicode, but socket.recv() returns a string
-
Owner
This seems fine.
-
Owner
This change looks ok, but this code does not seem to be already python 3 compatible.
I see
command = '127' ... request.send(command)
below, on python 3 that would
TypeError: a bytes-like object is required, not 'str'
maybe it works on python2
-
Developer
As far as I know, there is no unit test for equeue (and most of the resiliency tools) as the resilience tests were deemed to be enough, so I'm not surprised that many details are wrong for the python3 support.
Is there a test suite running the resilient test suite with all python services using python3 (I don't think it is easy to set up though) ?
Otherwise we should task someone to write unit tests for at least equeue and pubsub.
@jm , @bminusl : I'm tagging you because most probably you were not notified by @jerome 's comment.
-
Owner
Is there a test suite running the resilient test suite with all python services using python3 (I don't think it is easy to set up though) ?
not yet, but @luke and I are planning to make software/slapos-sr-testing run tests using python3. This will be a first step, because it would cover using slapos in python3 to install software and create instances. There are a few things not working with promises. We started to fix in slapos.core!146 (closed)
Otherwise we should task someone to write unit tests for at least equeue and pubsub.
It's not for me to decide, but equeue looks like something that we should not write ourselves. There are already existing / maintained packages for task queues. Also I don't know this code, but maybe just running process with a lockfile would have been enough.
-
Owner
- command = str(request_parameters['command']) + command = request_parameters['command']
- request.send(command) + request.send(command.encode())