From b5e965c48a88c40ba0ed7cdf66b725357e39f1f6 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Tue, 14 Aug 2012 21:08:54 +0000 Subject: [PATCH] Web: Decode _after_ reading the page in @fetch. --- plugins/Web/plugin.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/Web/plugin.py b/plugins/Web/plugin.py index f0fda9fe0..9a866a69b 100644 --- a/plugins/Web/plugin.py +++ b/plugins/Web/plugin.py @@ -250,9 +250,8 @@ class Web(callbacks.PluginRegexp): irc.error(_('This command is disabled ' '(supybot.plugins.Web.fetch.maximum is set to 0).'), Raise=True) - fd = utils.web.getUrlFd(url) \ - .decode('utf8', errors='replace') - irc.reply(fd.read(max)) + fd = utils.web.getUrlFd(url) + irc.reply(fd.read(max).decode('utf8', errors='replace')) fetch = wrap(fetch, ['url']) Class = Web