John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/235376

Change subject: Fix old version fetch
......................................................................

Fix old version fetch

d51b9977 replaced urllib2 with requests, introducing an exception
in the old version detection as it attempted to load json from
a file handle, but the file handle was changed to a decoded string.

Change-Id: I141d77183b63c6d6d417689eb61ea5e40df4fc55
---
M pywikibot/site_detect.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/76/235376/1

diff --git a/pywikibot/site_detect.py b/pywikibot/site_detect.py
index fed1f56..e5e9b1a 100644
--- a/pywikibot/site_detect.py
+++ b/pywikibot/site_detect.py
@@ -85,7 +85,7 @@
         if self.version is None:
             # try to get version using api
             try:
-                d = json.load(fetch(self.api + '?version&format=json').content)
+                d = json.loads(fetch(self.api + '?version&format=json').raw)
                 self.version = filter(
                     lambda x: x.startswith("MediaWiki"),
                     [l.strip()

-- 
To view, visit https://gerrit.wikimedia.org/r/235376
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I141d77183b63c6d6d417689eb61ea5e40df4fc55
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to