Skip to content

simulator.py/RpcHandler() needs encode/decode to work these days #173

@kiml

Description

@kiml

I needed to make the following change (Python 3.9) to make this code work.

@@ -90,13 +90,13 @@ class RpcHandler(SocketServer.BaseRequestHandler):
"""This function is called automatically by the SocketServer"""
# self.request is the TCP socket connected to the client
# read the incoming command

  •    request = self.request.recv(1024).strip()
    
  •    request = self.request.recv(1024).decode().strip()
       # write to the queue waiting to be processed by the server
       INPUT_QUEUE.put(request)
       # wait for the server answer in the output queue
       response = OUTPUT_QUEUE.get(timeout=5.0)
       # send back the answer
    
  •    self.request.send(response)
    
  •    self.request.send(response.encode())
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions