From: Eric S. Raymond Date: Thu, 11 Oct 2012 18:49:02 +0000 (-0400) Subject: Emergency fix for IRC library bug. X-Git-Tag: 1.12~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d1758db4e7bca50931a2405b4dd8c71085cc5e20;p=irker.git Emergency fix for IRC library bug. --- diff --git a/irkerd b/irkerd index a78a1fe..1e07a86 100755 --- a/irkerd +++ b/irkerd @@ -364,7 +364,7 @@ class Irker: self.irc.add_global_handler("featurelist", self._handle_features) self.irc.add_global_handler("disconnect", self._handle_disconnect) self.irc.add_global_handler("kick", self._handle_kick) - thread = threading.Thread(target=self.irc.process_forever) + thread = threading.Thread(target=self.process_forever) thread.setDaemon(True) self.irc._thread = thread thread.start() @@ -376,6 +376,16 @@ class Irker: "Debugging information." if self.debuglevel >= level: sys.stderr.write("irkerd: %s\n" % errmsg) + def process_forever(self, timeout=0.2): + "Shim - can be removed later." + # Kluge to get around the fact that 3.2 and older library + # versions do a Unicode decode where they shouldn't. + self.debug(1, "process_forever(timeout=%s)" % timeout) + while True: + try: + self.irc.process_once(timeout) + except UnicodeDecodingError: + pass def _handle_ping(self, connection, _event): "PING arrived, bump the last-received time for the connection." if connection.context: