jenkins-bot has submitted this change and it was merged.
Change subject: Use _siteinfo in is_uploaddisabled ......................................................................
Use _siteinfo in is_uploaddisabled
Change-Id: I2ce1f3c4410467216eda3d71577b54bd18d2581a --- M pywikibot/site.py 1 file changed, 4 insertions(+), 0 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py index 7e0fae9..a7c0bd4 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -1384,6 +1384,7 @@ 'writeapi', 'variantarticlepath', 'misermode', + 'uploadsenabled', ], 'namespaces': [ # for each namespace 'subpages', @@ -5473,10 +5474,13 @@ def is_uploaddisabled(self): """Return True if upload is disabled on site.
+ When the version is at least 1.27wmf9, uses general siteinfo. If not called directly, it is cached by the first attempted upload action.
""" + if MediaWikiVersion(self.version()) >= MediaWikiVersion('1.27wmf9'): + return not self._siteinfo.get('general')['uploadsenabled'] if hasattr(self, '_uploaddisabled'): return self._uploaddisabled else: