From bc1451e898d87c765c8c61c23d3d1d67d4179f16 Mon Sep 17 00:00:00 2001 From: James Vega Date: Wed, 29 Jun 2005 19:05:20 +0000 Subject: [PATCH] plugins/Web: Encountering an HTMLParser exception doesn't mean the title hasn't already been snarfed. Don't bail right away. --- plugins/Web/plugin.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plugins/Web/plugin.py b/plugins/Web/plugin.py index a1adb4a95..2bc8355ab 100644 --- a/plugins/Web/plugin.py +++ b/plugins/Web/plugin.py @@ -88,8 +88,8 @@ class Web(callbacks.PluginRegexp): try: parser.feed(text) except HTMLParser.HTMLParseError: - self.log.debug('Unable to parse %u', url) - return + self.log.debug('Encountered a problem parsing %u. Title may ' + 'already be set, though', url) if parser.title is not None: domain = utils.web.getDomain(url) title = utils.web.htmlToText(parser.title.strip()) @@ -164,9 +164,8 @@ class Web(callbacks.PluginRegexp): try: parser.feed(text) except HTMLParser.HTMLParseError: - irc.reply(format('That URL appears to have no HTML title within ' - 'the first %i bytes.', size)) - return + self.log.debug('Encountered a problem parsing %u. Title may ' + 'already be set, though', url) if parser.title is not None: irc.reply(utils.web.htmlToText(parser.title.strip())) else: