Skip to content

Ignore unmatched Creative Commons license end tags - #603

Open
terminalchai wants to merge 1 commit into
kurtmckee:mainfrom
terminalchai:fix/stray-license-end-tags
Open

terminalchai wants to merge 1 commit into
kurtmckee:mainfrom
terminalchai:fix/stray-license-end-tags

Conversation

@terminalchai

Copy link
Copy Markdown

An unmatched Creative Commons license closing tag, such as </creativeCommons:license>, currently makes feedparser.parse() raise KeyError: 'license'. Return when there is no matching license element, preserving existing license links and surrounding text without adding a spurious link.

This addresses the Creative Commons license cases reported in #599; other malformed-feed cases in that issue are outside this change.

Adds 14 regression cases covering bare closing tags, feed and entry contexts, namespace aliases, repeated closing tags after a valid license, and closing tags within title text. Includes a changelog fragment.

Validation on Windows with Python 3.11:

  • All 14 new regression cases failed with KeyError before the fix and pass afterward.
  • Full suite: 4,311 passed, 8 skipped.
  • Black, isort, flake8, mypy (33 source files), and git diff --check pass.

Prepared with AI assistance; the diff and regression results were reviewed before submission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant