Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated the list of things that might go wrong when fetching a feed...

  • Loading branch information...
commit 07ee7c12cf63012ec1a4a6adf472f905b9c7b587 1 parent 9a68d15
@jacobian jacobian authored
View
6 django_website/aggregator/management/commands/mark_defunct_feeds.py
@@ -1,5 +1,6 @@
import socket
import urllib2
+import httplib
from django.core.management.base import BaseCommand
from django_website.aggregator.models import Feed
@@ -10,8 +11,9 @@ class Command(BaseCommand):
def handle(self, *args, **kwargs):
for f in Feed.objects.filter(is_defunct=False):
try:
- r = urllib2.urlopen(f.feed_url, timeout=15)
- except (urllib2.HTTPError, urllib2.URLError, socket.timeout), e:
+ urllib2.urlopen(f.feed_url, timeout=15)
+ except (urllib2.HTTPError, urllib2.URLError, httplib.HTTPException,
+ socket.timeout), e:
print "%s on '%s'; marking defunct" % (e, f)
f.is_defunct = True
f.save()
Please sign in to comment.
Something went wrong with that request. Please try again.