diff options
author | Sean B. Palmer <http://inamidst.com/sbp/> | 2008-10-29 16:03:12 +0000 |
---|---|---|
committer | Sean B. Palmer <http://inamidst.com/sbp/> | 2008-10-29 16:03:12 +0000 |
commit | fe16d21212bacc9704a6cd84d3c85a6676936181 (patch) | |
tree | 1bdbc0b340e89fbe3255ebd9985fb482afd9f3d5 /irc.py | |
parent | b91de3886ecb38b6621dc35fa18a4c7f10fde780 (diff) | |
download | bot-fe16d21212bacc9704a6cd84d3c85a6676936181.tar.gz bot-fe16d21212bacc9704a6cd84d3c85a6676936181.tar.bz2 bot-fe16d21212bacc9704a6cd84d3c85a6676936181.zip |
Oblique stuff and fixes.
Diffstat (limited to 'irc.py')
-rwxr-xr-x | irc.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -52,10 +52,14 @@ class Bot(asynchat.async_chat): def write(self, args, text=None): # This is a safe version of __write + def safe(input): + input = input.replace('\n', '') + input = input.replace('\r', '') + return input.encode('utf-8') try: - args = [arg.encode('utf-8') for arg in args] + args = [safe(arg) for arg in args] if text is not None: - text = text.encode('utf-8') + text = safe(text) self.__write(args, text) except Exception, e: pass |