fix(standard_files): addIssue signature mismatch crashes test 9 on unreachable sites#1469
Merged
Merged
Conversation
…path addIssue() was defined with three positional arguments but called with four in the failure branch of run_test(). The extra argument was a text string carrying site-unavailable context that was never actually stored on the sub-issue. This commit adds `text` as an optional fourth parameter on addIssue and stores it on the sub-issue when provided. The call site is updated to pass arguments in the correct order: (result_dict, rule_id, url, text). All ~25 existing 3-argument call sites continue to work unchanged. Triggered by any site where the initial HTTP request raises ConnectionError, e.g. WAF-protected sites that drop python-requests at the TLS handshake (bolagsverket.se and other Swedish government sites confirmed).
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.
Fixes #1468
What this changes
Two minimal edits in
tests/standard_files.py:addIssue()accepts an optional fourth parametertext=None, stored on the sub-issue when providedrun_test()'s failure branch passes arguments in the correct order:(result_dict, rule_id, url, text)Backward compatibility
All ~25 existing 3-argument
addIssuecalls in this file work unchanged thanks to the defaulttext=None. No other files need to be touched.Testing
Verified locally against:
https://bolagsverket.se(previously crashed withTypeError) — now returns a gracefulno-networkresult with the localised TEXT_SITE_UNAVAILABLE text attached to the sub-issue