Commits

Martin Thorsen Ranang committed 06128e8

Make Incoming.processFrame() more robust, adding explicit data encoding to avoid "exceptions.TypeError: Data must not be unicode" error.

Comments (0)

Files changed (1)

daemon/orbited/proxy.py

         self.logger.debug('processFrame: %s %s %s'%(socketId, frameType, data))
         if frameType == FRAME_CLOSE:
             return self.closeStream(socketId, 'UserConnectionReset')
-        if frameType == FRAME_DATA:        
-            return self.sockets[socketId].transport.write(data)
+        if frameType == FRAME_DATA:
+            return self.sockets[socketId].transport.write(data.encode("ascii"))
         return self.closeStream(socketId, 'ProtocolError')
         
     def dataReceived(self, rawdata=""):