jsumners / jsumners/feedparser

UndeclaredNamespace error with feedparser

Open
#428 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-migrated
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

What steps will reproduce the problem?
1. I am running feed = feedparser.parse(in_feed)' where 
in_feed=feeds.mashable.com/Mashable


What is the expected output? What do you see instead?
It should not return an error as all other rss feeds from the opml file are 
working.

What version of the product are you using? On what operating system?
os: 14.04 LTS
Python: Python 2.7.6
Feedparser 5.1.3
Beautiful Soup 4.2.1
lxml 3.3.3

Please provide any additional information below:

Hello I am getting the following error when using Feedparser:

    raise UndeclaredNamespace, "'%s' is not associated with a namespace" % givenprefix feedparser.UndeclaredNamespace: 'media' is not associated with a namespace

I have managed to narrow it down to one feed which is the cause:

    http://feeds.mashable.com/Mashable

I am writing a web scraper which uses Feedparser and Beautiful soup to scrape 
news articles from various rss feed that I am interested in, I am writing this 
using Python.

The error message is this:

feed = feedparser.parse(in_feed)
File "/usr/lib/python2.7/dist-packages/feedparser.py", line 4014, in parse
saxparser.parse(source)
File "/usr/lib/python2.7/dist-packages/drv_libxml2.py", line 208, in parse
eltName,eltQName,attributesNSImpl) 
File "/usr/lib/python2.7/dist-packages/feedparser.py", line 1809, in 
startElementNS
raise UndeclaredNamespace, "'%s' is not associated with a namespace" % 
givenprefix
feedparser.UndeclaredNamespace: 'media' is not associated with a namespace 

Original issue reported on code.google.com by omran.na...@googlemail.com on 3 Aug 2014 at 12:11

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with http://feeds.mashable.com/Mashable using feedparser.parse, then inspect feedparser.py and drv_libxml2.py around startElementNS and the reported UndeclaredNamespace path. Done means this feed parses without raising the 'media' namespace error while the existing RSS feeds continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.