Opened 18 years ago

Closed 18 years ago

#2218 closed defect (duplicate)

AttributeError in syndication/feeds.py

Reported by: jvinet@… Owned by: Jacob
Component: Documentation Version: dev
Severity: normal Keywords: feed
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I've set up a basic feed for news updates, but when trying to access it, I get an AttributeError: 'NoneType' object has no attribute 'startswith'.

This fixes it for me:

--- feeds.py.old 2006-06-22 20:41:57.000000000 -0700
+++ feeds.py 2006-06-22 20:42:01.000000000 -0700
@@ -5,7 +5,7 @@

from django.conf import settings

def add_domain(domain, url):

+ if url and not url.startswith('http://'):

url = u'http://%s%s' % (domain, url)

return url

Not sure if I've set something up wrong or not, but with this patch, the feed works as expected.

I'm running off the latest SVN revision.

Change History (2)

comment:1 by Malcolm Tredinnick, 18 years ago

Component: RSS frameworkDocumentation
Owner: changed from Adrian Holovaty to Jacob

This is a documentation bug, not a code bug. I believe that all of the places where we call add_domain require a real URL, it is not optional in the feed specs (need to check all the specs to make sure, though). So we shouldn't let people avoid having URLs in these places.

A better error message wouldn't kill us in those cases, too -- explaining where the URL was forgotten.

comment:2 by James Bennett, 18 years ago

Resolution: duplicate
Status: newclosed

This is a duplicate of #1961, which I'm going to reopen.

Note: See TracTickets for help on using tickets.
Back to Top