Commits

Jason R. Coombs committed 6d3fc54

Use correct types for line buffering bytes off the socket.

Comments (0)

Files changed (1)

 
 # Huh!?  Crrrrazy EFNet doesn't follow the RFC: their ircd seems to
 # use \n as message separator!  :P
-_linesep_regexp = re.compile("\r?\n")
+_linesep_regexp = re.compile(b"\r?\n")
 
 class ServerConnection(Connection):
     """This class represents an IRC server connection.
         if self.connected:
             self.disconnect("Changing servers")
 
-        self.previous_buffer = ""
+        self.previous_buffer = b""
         self.handlers = {}
         self.real_server_name = ""
         self.real_nickname = nickname
         self.previous_buffer = lines.pop()
 
         for line in lines:
+            line = line.decode('utf-8')
+
             log.debug("FROM SERVER: %s", line)
 
             if not line: