Xqt has uploaded a new change for review.

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

Change subject: [bugfix] force wikistats fields to unicode when using xml format
......................................................................

[bugfix] force wikistats fields to unicode when using xml format

Bug: T128990
Change-Id: I26cc4dbc7a9a04b5c6545bbacfd52a07e6bb9a69
---
M pywikibot/data/wikistats.py
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/80/275780/1

diff --git a/pywikibot/data/wikistats.py b/pywikibot/data/wikistats.py
index cae468f..86d9a72 100644
--- a/pywikibot/data/wikistats.py
+++ b/pywikibot/data/wikistats.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8  -*-
 """Objects representing WikiStats API."""
 #
-# (C) Pywikibot team, 2014
+# (C) Pywikibot team, 2014-2016
 #
 # Distributed under the terms of the MIT license.
 from __future__ import absolute_import, unicode_literals
@@ -14,6 +14,7 @@
 
 if sys.version_info[0] > 2:
     import csv
+    unicode = str
 else:
     try:
         import unicodecsv as csv
@@ -184,7 +185,7 @@
             site = {}
 
             for field in row.findall('field'):
-                site[field.get('name')] = field.text
+                site[field.get('name')] = unicode(field.text)
 
             data.append(site)
 

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

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

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

Reply via email to