mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-19 08:59:27 +01:00
Socket: Gracefully handle invalid lines with UTF8ONLY
Just skip the line, instead of crashing the whole loop (which contains the next lines from the same server too)
This commit is contained in:
parent
ee9f0dc1bf
commit
76bd1c89bf
@ -216,7 +216,11 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
|
|||||||
and 'UTF8ONLY' in self.irc.state.supported:
|
and 'UTF8ONLY' in self.irc.state.supported:
|
||||||
# No need for the fancy charset-guessing used in
|
# No need for the fancy charset-guessing used in
|
||||||
# decode_raw_line.
|
# decode_raw_line.
|
||||||
line = line.decode('utf8')
|
try:
|
||||||
|
line = line.decode('utf8')
|
||||||
|
except UnicodeError:
|
||||||
|
drivers.log.exception('Could not decode line %r', line)
|
||||||
|
continue
|
||||||
else:
|
else:
|
||||||
line = decode_raw_line(line)
|
line = decode_raw_line(line)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user