Repository navigation
rss-bot: Ignore empty lines and comments in feed file - #935
Open
SPY-Github22 wants to merge 1 commit into
Open
SPY-Github22 wants to merge 1 commit into
SPY-Github22 wants to merge 1 commit into
Conversation
An empty line in the feeds configuration file caused rss-bot to compute an empty netloc, leading to an IsADirectoryError when attempting to open the feed hashes cache path. Skip empty or whitespace-only lines and lines starting with '#' when reading feed files, and guard against URLs lacking a netloc. Add unit tests verifying handling of blank lines, comments, and missing files, and include rss integration dependencies in root requirements.txt for test execution. Fixes zulip#920.
SPY-Github22
force-pushed
the
fix-rss-bot-empty-feed-lines
branch
from
November 2, 2026 05:30
1000a6b to
5cec695
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fixes #920.
When the
rss-feedsconfiguration file contains blank lines, whitespace, or comments,rss-botparsed them as feed URLs. An empty string has an emptynetloc, causingos.path.join(data_dir, "")to point to the cache directory itself rather than a file. When the script attempted to open this path, Python raised:Changes
#when readingfeed_file.netloc.zulip/integrations/rss/test_rss.pyverifying:Testing Done
pytest zulip/integrations/rss/test_rss.py(3 passed).