Skip to content

Commit 0153484

Browse files
committed
httptools: Fix encoding issue with request post data (2/3 compat)
1 parent bec3501 commit 0153484

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

qencode/httptools.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import unicode_literals
2+
13
import json
24

35
from ._compat import HTTPError, Request, URLError, urlencode, urljoin, urlopen
@@ -13,7 +15,7 @@ def _call_server(self, url, post_data):
1315
if not url:
1416
response = dict(error=True, message='AttributeError: Bad URL')
1517
return json.dumps(response)
16-
data = urlencode(post_data)
18+
data = urlencode(post_data).encode("utf-8")
1719
request = Request(url, data)
1820
try:
1921
res = urlopen(request)

0 commit comments

Comments
 (0)