Skip to content

fix: guard enclosure against None/non-positive length values - #457

Open
Zerthick wants to merge 1 commit into
Guts:mainfrom
Zerthick:fix/enclosure-length-guard
Open

fix: guard enclosure against None/non-positive length values#457
Zerthick wants to merge 1 commit into
Guts:mainfrom
Zerthick:fix/enclosure-length-guard

Conversation

@Zerthick

Copy link
Copy Markdown

Description

Guard <enclosure> element against None or non-positive length values in the RSS feed.

When a remote image returns 404, the length field becomes None, which would produce invalid XML like <enclosure length="None" />. This PR adds a guard to skip the enclosure element when length is None or non-positive.

Changes

  • Add guard condition in rss.xml.jinja2 template: check that item.image[2] is not None and is greater than 0
  • Add test verifying no invalid enclosure length values in output

Split from: #451


💡 AI Contribution Level: 8 — Based on the VisiData AI contribution scale, this was an AI-assisted contribution where the AI performed the code splitting and PR creation with minimal human guidance.

When a remote image returns 404, the length field becomes None,
producing invalid XML. Added guard to skip enclosure when length
is None or non-positive.

- Add guard condition in rss.xml.jinja2 template
- Add test verifying no invalid enclosure length values
@github-actions github-actions Bot added bug Something isn't working quality Tests, project resiliency, etc. labels Aug 10, 2026
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.16%. Comparing base (1b5e630) to head (1bf72fe).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #457   +/-   ##
=======================================
  Coverage   83.16%   83.16%           
=======================================
  Files          11       11           
  Lines         784      784           
  Branches      133      133           
=======================================
  Hits          652      652           
  Misses         86       86           
  Partials       46       46           
Flag Coverage Δ
unittests 83.16% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

bug Something isn't working quality Tests, project resiliency, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant