fortinet: repair query() mangled by a bad merge (syntax error on main) - #290
Merged
Conversation
Merge c89c607 ("Merge branch 'main' into fix/268-fortinet-unfiltered-content") stacked three overlapping copies of the query() loop body on top of each other, leaving a `try:` with no matching `except`/`finally` at line 95. modules/fortinet/ feed.py has not parsed on main since -- test_feed_contracts, test_module_contracts and everything importing the module fail, so the stdlib-unittest check is red on every PR against main. Reconstructed from the last parsing revision (c76c439) by applying only the intended FeedResult error-contract changes, matching the sibling multi-source modules migrated in c7acb1a: - import feedutils; collect per-source errors in `errors` - wrap each URL in try/except -> errors.append((URL, str(e))); continue - content=None guard so an entry that fails the CVSS filter is skipped, not posted with the previous entry's content - break (not return) on IndexError so remaining URLs are still processed - return feedutils.result(items, errors)
Collaborator
Author
|
Merge order — please merge this first. This repairs a syntax error in It unblocks #289, whose CI is failing only because of this same pre-existing break (not because of anything in #289). Once this lands on |
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
modules/fortinet/feed.pydoes not parse onmain— atry:at line 95 has no matchingexcept/finally:Merge
c89c607("Merge branch 'main' into fix/268-fortinet-unfiltered-content") stacked three overlapping copies of thequery()loop body on top of each other. The file has not parsed since, sotest_feed_contracts,test_module_contractsand every test importing the module fail — thestdlib unittestcheck is red on every PR againstmain, not just one.Fix
Reconstructed from the last revision that parsed (
c76c439) by re-applying only the intended FeedResult error-contract changes, matching the sibling multi-source modules migrated inc7acb1a:import feedutils; collect per-source errors inerrorstry/except→errors.append((URL, str(e))); continuecontent = Noneguard so an entry that fails the CVSS filter is skipped, not posted with the previous entry's contentbreak(notreturn) onIndexError, so the remaining URLs are still processedreturn feedutils.result(items, errors)The diff against
c76c439is exactly those changes and nothing else.Testing
python -m unittest tests.test_feed_contracts tests.test_module_contracts tests.test_import_path_safety→ 21/21 pass (were erroring on the parse failure). File byte-compiles.