Skip to content

Instantly share code, notes, and snippets.

@mybeky
Created December 5, 2011 05:13
Show Gist options
  • Save mybeky/1432393 to your computer and use it in GitHub Desktop.
Save mybeky/1432393 to your computer and use it in GitHub Desktop.
diff --git a/lixian.py b/lixian.py
index 05331e4..7139f51 100644
--- a/lixian.py
+++ b/lixian.py
@@ -37,7 +37,7 @@ class XunleiClient:
def urlopen(self, url, **args):
#print url
if 'data' in args and type(args['data']) == dict:
- args['data'] = urllib.urlencode(args['data'])
+ args['data'] = urllib.urlencode(dict([k, unicode(v).encode('utf-8')] for k, v in args['data'].items()))
return self.opener.open(urllib2.Request(url, **args))
def load_cookies(self):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment