Specifically only catch UnicodeDecodeError in IRCSocket.read
This commit is contained in:
parent
1dad4827b6
commit
c842c459f4
1 changed files with 2 additions and 2 deletions
|
@ -105,12 +105,12 @@ class Socket(IRCObject.Object):
|
||||||
for line in data_lines:
|
for line in data_lines:
|
||||||
try:
|
try:
|
||||||
decoded_line = line.decode(self._encoding)
|
decoded_line = line.decode(self._encoding)
|
||||||
except:
|
except UnicodeDecodeError:
|
||||||
self.log.trace("can't decode line with '%s', falling back",
|
self.log.trace("can't decode line with '%s', falling back",
|
||||||
[self._encoding])
|
[self._encoding])
|
||||||
try:
|
try:
|
||||||
decoded_line = line.decode(self._fallback_encoding)
|
decoded_line = line.decode(self._fallback_encoding)
|
||||||
except:
|
except UnicodeDecodeError:
|
||||||
continue
|
continue
|
||||||
decoded_lines.append(decoded_line)
|
decoded_lines.append(decoded_line)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue