You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This feed is not actually a feed but rather a 302 redirect. But the 302 is missing the Location header which would then be used by feed parser. Instead, we get an AttributeError:
>>> import feedparser
>>> fp = feedparser.parse('http://tools.microformatic.com/transcode/rss/hatom/http://fusesource.com')
Traceback (most recent call last):
File "/usr/local/lib/python3.9/code.py", line 90, in runcode
exec(code, self.locals)
File "<console>", line 1, in <module>
File "/usr/local/lib/python3.9/site-packages/feedparser/api.py", line 214, in parse
data = _open_resource(url_file_stream_or_string, etag, modified, agent, referrer, handlers, request_headers, result)
File "/usr/local/lib/python3.9/site-packages/feedparser/api.py", line 114, in _open_resource
return http.get(url_file_stream_or_string, etag, modified, agent, referrer, handlers, request_headers, result)
File "/usr/local/lib/python3.9/site-packages/feedparser/http.py", line 158, in get
f = opener.open(request)
File "/usr/local/lib/python3.9/urllib/request.py", line 523, in open
response = meth(req, response)
File "/usr/local/lib/python3.9/urllib/request.py", line 632, in http_response
response = self.parent.error(
File "/usr/local/lib/python3.9/urllib/request.py", line 555, in error
result = self._call_chain(*args)
File "/usr/local/lib/python3.9/urllib/request.py", line 494, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.9/site-packages/feedparser/http.py", line 56, in http_error_301
result.status = code
AttributeError: 'NoneType' object has no attribute 'status'
Should feedparser be able to handle a broken feed that's broken like this?
The text was updated successfully, but these errors were encountered:
samuelclay
changed the title
Feed has a 302 redirect but feed parser throws AttributeError: 'NoneType' object has no attribute 'status'
Feed has a 302 redirect but feedparser throws AttributeError: 'NoneType' object has no attribute 'status'
Mar 3, 2021
This feed is not actually a feed but rather a 302 redirect. But the 302 is missing the
Location
header which would then be used by feed parser. Instead, we get anAttributeError
:Here's the feed headers:
Should feedparser be able to handle a broken feed that's broken like this?
The text was updated successfully, but these errors were encountered: