Merge branch 'py3k-backport' into testing

This commit is contained in:
Valentin Lorentz 2012-09-22 17:34:42 +00:00
commit 5dbf4a58c7

View File

@ -29,6 +29,7 @@
###
import re
import sys
import HTMLParser
import htmlentitydefs
@ -105,6 +106,8 @@ class Web(callbacks.PluginRegexp):
if parser.title:
domain = utils.web.getDomain(url)
title = utils.web.htmlToText(parser.title.strip())
if sys.version_info[0] < 3:
title = title.encode('utf8', errors='replace')
s = format(_('Title: %s (at %s)'), title, domain)
irc.reply(s, prefixNick=False)
titleSnarfer = urlSnarfer(titleSnarfer)