web: encode to utf-8 before submitting

This commit is contained in:
mutantmonkey
2011-11-30 16:05:09 -05:00
parent 0b5398ca04
commit cd9f5ac8e2

2
web.py
View File

@@ -40,7 +40,7 @@ def head(uri):
def post(uri, query):
if not uri.startswith('http'):
return
data = urllib.parse.urlencode(query)
data = urllib.parse.urlencode(query).encode('utf-8')
u = urllib.request.urlopen(uri, data)
bytes = u.read()
try: