Web: Decode _after_ reading the page in @fetch.

This commit is contained in:
Valentin Lorentz 2012-08-14 21:08:54 +00:00
parent 653e4dec1b
commit b5e965c48a

View File

@ -250,9 +250,8 @@ class Web(callbacks.PluginRegexp):
irc.error(_('This command is disabled ' irc.error(_('This command is disabled '
'(supybot.plugins.Web.fetch.maximum is set to 0).'), '(supybot.plugins.Web.fetch.maximum is set to 0).'),
Raise=True) Raise=True)
fd = utils.web.getUrlFd(url) \ fd = utils.web.getUrlFd(url)
.decode('utf8', errors='replace') irc.reply(fd.read(max).decode('utf8', errors='replace'))
irc.reply(fd.read(max))
fetch = wrap(fetch, ['url']) fetch = wrap(fetch, ['url'])
Class = Web Class = Web