fix GET
This commit is contained in:
parent
a3c470847d
commit
f630877098
1 changed files with 1 additions and 1 deletions
|
@ -51,7 +51,7 @@ def open_url(url, data=None, headers=DEFAULT_HEADERS):
|
||||||
if isinstance(url, bytes):
|
if isinstance(url, bytes):
|
||||||
url = url.decode('utf-8')
|
url = url.decode('utf-8')
|
||||||
url = url.replace(' ', '%20')
|
url = url.replace(' ', '%20')
|
||||||
if PY3 and not isinstance(data, bytes):
|
if data and PY3 and not isinstance(data, bytes):
|
||||||
data = data.encode('utf-8')
|
data = data.encode('utf-8')
|
||||||
req = urllib.request.Request(url, data, headers)
|
req = urllib.request.Request(url, data, headers)
|
||||||
return urllib.request.urlopen(req)
|
return urllib.request.urlopen(req)
|
||||||
|
|
Loading…
Reference in a new issue