jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1335903?usp=email )
Change subject: [bugfix] Honour -ignore HTTP status codes in weblinkchecker
......................................................................
[bugfix] Honour -ignore HTTP status codes in weblinkchecker
The -ignore option is documented as a list of HTTP return codes to
ignore, but the status check combined the codes with "or", so any code
passed to -ignore was always treated as a dead link. The second clause
could never change the outcome either, because a code listed in
-ignore is never HTTPStatus.OK.
Combine the two conditions with "and" instead, so a response is only
reported as bad when it is neither OK nor explicitly ignored.
Change-Id: Id5097dabadc9217ca14c90b405ae2f0f33ce2158
---
M scripts/weblinkchecker.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py
index 49e0815..1769337 100755
--- a/scripts/weblinkchecker.py
+++ b/scripts/weblinkchecker.py
@@ -305,7 +305,7 @@
self.url, headers=header,
use_fake_user_agent=self._use_fake_user_agent)
bad = (r.status_code != HTTPStatus.OK
- or r.status_code in self.http_ignores)
+ and r.status_code not in self.http_ignores)
message = HTTPStatus(r.status_code).phrase
except (requests.exceptions.InvalidURL, FatalServerError):
bad = True
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1335903?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Id5097dabadc9217ca14c90b405ae2f0f33ce2158
Gerrit-Change-Number: 1335903
Gerrit-PatchSet: 2
Gerrit-Owner: Mahveotm <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]