[Pywikipedia-l] SVN: [6041] branches/rewrite/pywikibot/data/api.py

nicdumz at svn.wikimedia.org nicdumz at svn.wikimedia.org
Wed Oct 29 04:24:40 UTC 2008


Revision: 6041
Author:   nicdumz
Date:     2008-10-29 04:24:40 +0000 (Wed, 29 Oct 2008)

Log Message:
-----------
yes, query-continue can return ints ... but sometimes also some non-ascii characters :)

Modified Paths:
--------------
    branches/rewrite/pywikibot/data/api.py

Modified: branches/rewrite/pywikibot/data/api.py
===================================================================
--- branches/rewrite/pywikibot/data/api.py	2008-10-28 22:15:22 UTC (rev 6040)
+++ branches/rewrite/pywikibot/data/api.py	2008-10-29 04:24:40 UTC (rev 6041)
@@ -409,8 +409,11 @@
                 raise Error("Missing '%s' key in ['query-continue'] value."
                             % self.module)
             update = self.data["query-continue"][self.module]
-            for key in update:
-                self.request[key] = str(update[key])
+            for key, value in update.iteritems():
+                # query-continue can return ints
+                if isinstance(value, int):
+                    value = str(value)
+                self.request[key] = value
 
     def result(self, data):
         """Process result data as needed for particular subclass."""





More information about the Pywikipedia-l mailing list