diff -r e7999383db5a -r 6672cecf3ed1 cobalt.py --- a/cobalt.py Sun Jun 15 21:19:43 2014 +0300 +++ b/cobalt.py Mon Jun 16 00:14:56 2014 +0300 @@ -166,7 +166,7 @@ sys.excepthook = handle_exception def check_admin (sender, ident, host, command): - if not "%s!%s@%s" % (sender, ident, host) in g_admins: + if not "%s@%s" % (ident, host) in g_admins: raise logical_exception (".%s requires admin access" % command) class logical_exception (Exception): @@ -246,7 +246,11 @@ def handle_read (self): lines = self.recv (4096).splitlines() for utfline in lines: - line = utfline.decode("utf-8").encode("ascii","ignore") + try: + line = utfline.decode("utf-8").encode("ascii","ignore") + except UnicodeDecodeError: + continue + if self.verbose: print "[%s] -> %s" % (self.name, line)