Module: deluge
Branch: master
Commit: 815a71fe8b3c5b845ce9e7e26275ec069931b189

Author: John Garland <[email protected]>
Date:   Sat May  8 15:50:04 2010 +1000

Try favicon.ico if there's a HTMLParseError

---

 deluge/ui/tracker_icons.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/deluge/ui/tracker_icons.py b/deluge/ui/tracker_icons.py
index 245eddf..e9c23ab 100644
--- a/deluge/ui/tracker_icons.py
+++ b/deluge/ui/tracker_icons.py
@@ -34,7 +34,7 @@
 #
 
 import os
-from HTMLParser import HTMLParser
+from HTMLParser import HTMLParser, HTMLParseError
 from urlparse import urljoin, urlparse
 from tempfile import mkstemp
 
@@ -352,7 +352,7 @@ class TrackerIcons(Component):
                                callbackArgs=(host,), errbackArgs=(host,))
         elif f.check(error.NoResource, error.ForbiddenResource) and icons:
             d = self.download_icon(icons, host)
-        elif f.check(IndexError):
+        elif f.check(IndexError, HTMLParseError):
             # No icons, try favicon.ico as an act of desperation
             d = self.download_icon([(urljoin(host_to_url(host), 
"favicon.ico"), extension_to_mimetype("ico"))], host)
             d.addCallbacks(self.on_download_icon_complete, 
self.on_download_icon_fail,

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to