Skip to content

bug: RSS converter crashes with UnboundLocalError when channel title is missing #1946

Closed

Description

@hanhan761

Description

_rss_converter.py:_parse_rss_type() crashes with UnboundLocalError when an RSS feed has no <title> element in the channel (or the title element is empty).

Root Cause

In _rss_converter.py lines 146-157, md_text is only initialized inside the if channel_title: block. If channel_title is None or empty (which happens when the RSS feed has no <title> tag), md_text is never assigned. The subsequent md_text += ... operations then raise UnboundLocalError.

Reproduction

Convert an RSS feed XML file where the <channel> element has no <title> child.

Expected Behavior

The conversion should succeed, producing markdown output without a top-level heading. Missing optional fields should be handled gracefully.

Proposed Fix

Initialize md_text = "" before the if channel_title: block, so the subsequent += operations work correctly regardless of whether the title is present.

Activity

  1. afourney commented on Sep 4, 2026

    @afourney
    Member

    This was fixed by #2164, which initializes the output independently of the optional channel title. I’m closing this as resolved. Please reopen with a reproducer if the issue persists.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions