jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] checkimages: Expect NoPage exception
......................................................................
[FIX] checkimages: Expect NoPage exception
In compat the script called `getHash` which returned None if the image is
missing while `latest_file_info` raises a NoPage exception.
The script was previously fixed in 88ad247f and the usage was changed into
`getFileSHA1Sum` which would raise a `TypeError` if the page doesn't exist.
Bug: T105727
Change-Id: I9c39c41b86125ab7eeb1e842faad2a2cecbcb637
(cherry picked from commit 4bd04db59ba76534c165f2d674f5bebd1c156cd2)
---
M scripts/checkimages.py
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index e889f4d..985c554 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -905,8 +905,9 @@
"""Checking if the file is on commons."""
pywikibot.output(u'Checking if [[%s]] is on commons...'
% self.imageName)
- hash_found = self.image.latest_file_info.sha1
- if not hash_found:
+ try:
+ hash_found = self.image.latest_file_info.sha1
+ except pywikibot.NoPage:
return # Image deleted, no hash found. Skip the image.
site = pywikibot.Site('commons', 'commons')
--
To view, visit
https://gerrit.wikimedia.org/r/242520
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9c39c41b86125ab7eeb1e842faad2a2cecbcb637
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>