potential fix for unicode crash

master
mutantmonkey 2012-02-06 22:58:53 -05:00
parent e21b2f6ec7
commit f7d3b5f625
1 changed files with 4 additions and 1 deletions

5
irc.py
View File

@ -126,7 +126,10 @@ class Bot(asynchat.async_chat):
line = line[:-1]
self.buffer = b''
line = line.decode('utf-8')
try:
line = line.decode('utf-8')
except UnicodeDecodeError:
line = line.decode('iso-8859-1')
if line.startswith(':'):
source, line = line[1:].split(' ', 1)