jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/460757 )
Change subject: [bugfix] use Site.lang property for targetSite ......................................................................
[bugfix] use Site.lang property for targetSite
- Creating Site object for targetSite fails due to the deprecated method "language" is passed to the Site() creator instead of the method's result. Do not use deprecated Site.language method but the lang property instead. - Use image_repository instead of the hardcoded Site.
Bug: T204445 Change-Id: I8e18b43c4bcc693fb82e900f2ffb2f2400783f20 --- M scripts/imagetransfer.py 1 file changed, 4 insertions(+), 6 deletions(-)
Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/imagetransfer.py b/scripts/imagetransfer.py index 6f606df..c14431f 100755 --- a/scripts/imagetransfer.py +++ b/scripts/imagetransfer.py @@ -312,14 +312,12 @@ pywikibot.bot.suggest_help(missing_parameters=['page']) return False
+ site = pywikibot.Site() if not targetLang and not targetFamily: - targetSite = pywikibot.Site('commons', 'commons') + targetSite = site.image_repository() else: - if not targetLang: - targetLang = pywikibot.Site().language - if not targetFamily: - targetFamily = pywikibot.Site().family - targetSite = pywikibot.Site(targetLang, targetFamily) + targetSite = pywikibot.Site(targetLang or site.lang, + targetFamily or site.family) bot = ImageTransferBot(gen, interwiki=interwiki, targetSite=targetSite, keep_name=keep_name) bot.run()