jsumners / jsumners/feedparser

media:title ignored or used for main item title

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

Nobody has claimed this yet.

auto-migrated Component-Parser Namespace-media Type-Defect
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

** What steps will reproduce the problem?

To reproduce, download the attached file and run:

python -m feedparser file:///Path/to/media_title_error.xml

** What is the expected output? What do you see instead?

For example, the attached file has a media:content element, with a media:title 
element inside. This produces this list of entries:

[{
    'media_content': [{'medium': u'image',
                       'url': u'http://example.com/image.jpg'}],
    'title': u'MAIN TITLE',
    'title_detail': {'base': u'file://Path/to/media_title_error.xml',
           'language': None,
           'type': 'text/plain',
           'value': u'MAIN TITLE'}}],

I would expect the title of the media_content element to appear:

[{'media_content': [{'medium': u'image',
                             'url': u'http://example.com/image.jpg'
                             'title': u'MEDIA TITLE'}],
    'title': u'MAIN TITLE',
    'title_detail': {'base': u'file://Path/to/media_title_error.xml',
                               'language': None,
                               'type': 'text/plain',
                               'value': u'MAIN TITLE'}}],

** What version of the product are you using? On what operating system?

I'm using feedparser-5.0.1 on Python 2.6.1 on Mac OS X 10.6.6. I also tried SVN 
HEAD with the same result.

** Please provide any additional information below.

If the parent feed item doesn't have a title element, the media:title content 
appears as the item's title instead. This suggests that this bug is related to 
issue #76:

http://code.google.com/p/feedparser/issues/detail?id=76

Original issue reported on code.google.com by jesse.ru...@gmail.com on 3 Mar 2011 at 7:14

Attachments:

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

Start by running python -m feedparser with the attached media_title_error.xml and inspect how media:title is handled inside media:content. Confirm the expected result: the media item gets its own title while the parent entry keeps MAIN TITLE; also check the reported behavior when the parent has no title.】【。

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
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.