mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 12:42:34 +01:00
Web: Add explicit error when page encoding cannot be guessed.
This commit is contained in:
parent
d2046a81a2
commit
8ab29fb291
@ -270,9 +270,12 @@ class Web(callbacks.PluginRegexp):
|
||||
try:
|
||||
text = text.decode(utils.web.getEncoding(text) or 'utf8',
|
||||
'replace')
|
||||
except:
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
parser = Title()
|
||||
if sys.version_info[0] >= 3 and isinstance(text, bytes):
|
||||
irc.error(_('Could not guess the page\'s encoding. (Try '
|
||||
'installing python-charade'), Raise=True)
|
||||
try:
|
||||
parser.feed(text)
|
||||
except HTMLParser.HTMLParseError:
|
||||
|
Loading…
Reference in New Issue
Block a user