Revision: 5231 Author: russblau Date: 2008-04-18 08:57:36 +0000 (Fri, 18 Apr 2008)
Log Message: ----------- urlencode doesn't play nicely with Unicode
Modified Paths: -------------- branches/rewrite/pywikibot/data/api.py
Modified: branches/rewrite/pywikibot/data/api.py =================================================================== --- branches/rewrite/pywikibot/data/api.py 2008-04-17 17:54:39 UTC (rev 5230) +++ branches/rewrite/pywikibot/data/api.py 2008-04-18 08:57:36 UTC (rev 5231) @@ -142,7 +142,8 @@ raise TypeError("Query format '%s' cannot be parsed." % self.params['format']) uri = self.site.scriptpath() + "/api.php" - params = urllib.urlencode(self.params) + params = urllib.urlencode([(k, v.encode("utf8")) + for (k, v) in self.params.items()]) while True: # TODO catch http errors try: