diff options
author | Martin Panter <vadmium+py@gmail.com> | 2015-11-24 22:57:46 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2015-11-24 22:57:46 (GMT) |
commit | f7e8d07538a1734bdb0438ab53e0a54db456d4d9 (patch) | |
tree | 623f16d6b62025309c0041c3b053179fe3cf8125 /Doc/howto | |
parent | 6e701310d111452fa63de967ea8c624dd391167d (diff) | |
parent | cda85a0d1ca217c927211af799072c85b04b4e89 (diff) | |
download | cpython-f7e8d07538a1734bdb0438ab53e0a54db456d4d9.zip cpython-f7e8d07538a1734bdb0438ab53e0a54db456d4d9.tar.gz cpython-f7e8d07538a1734bdb0438ab53e0a54db456d4d9.tar.bz2 |
Issue #25576: Merge www-form-urlencoded doc from 3.4 into 3.5
Diffstat (limited to 'Doc/howto')
-rw-r--r-- | Doc/howto/urllib2.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst index e3d7714..9052ed5 100644 --- a/Doc/howto/urllib2.rst +++ b/Doc/howto/urllib2.rst @@ -115,7 +115,7 @@ library. :: 'language' : 'Python' } data = urllib.parse.urlencode(values) - data = data.encode('utf-8') # data should be bytes + data = data.encode('ascii') # data should be bytes req = urllib.request.Request(url, data) with urllib.request.urlopen(req) as response: the_page = response.read() @@ -180,8 +180,8 @@ Explorer [#]_. :: 'language' : 'Python' } headers = { 'User-Agent' : user_agent } - data = urllib.parse.urlencode(values) - data = data.encode('utf-8') + data = urllib.parse.urlencode(values) + data = data.encode('ascii') req = urllib.request.Request(url, data, headers) with urllib.request.urlopen(req) as response: the_page = response.read() |