jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/640229 )
Change subject: [bugfix] Do not use UploadRobot.run() with imagetransfer ......................................................................
[bugfix] Do not use UploadRobot.run() with imagetransfer
imagetransfer needs the final target filename for tagging nocommons template. Therefore don't use bulk upload with UploadRobot.run() but use the UploadRobot.upload_file method to upload a single file.
Bug: T267579 Change-Id: I9b792bd850de8686ffd3a6ef4a58822565eca1b7 --- M scripts/imagetransfer.py 1 file changed, 7 insertions(+), 3 deletions(-)
Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/imagetransfer.py b/scripts/imagetransfer.py index 0d11a80..0171c19 100755 --- a/scripts/imagetransfer.py +++ b/scripts/imagetransfer.py @@ -197,9 +197,13 @@ keep_filename=self.keep_name, verify_description=not self.keep_name, ignore_warning=self.ignore_warning) + # try to upload - targetFilename = bot.run() - if targetFilename and self.targetSite.family.name == 'commons' \ + if bot.self.skip_run(): + return + target_filename = bot.upload_file(url) + + if target_filename and self.targetSite.family.name == 'commons' \ and self.targetSite.code == 'commons': # upload to Commons was successful reason = i18n.twtranslate(sourceSite, @@ -217,7 +221,7 @@ + sourceImagePage.title()) sourceImagePage.put(sourceImagePage.get() + '\n\n' + nowCommonsTemplate[sourceSite.lang] - % targetFilename, + % target_filename, summary=reason)
def show_image_list(self, imagelist):
pywikibot-commits@lists.wikimedia.org