summaryrefslogtreecommitdiffstats
path: root/Doc/howto/urllib2.rst
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2015-11-24 22:33:18 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2015-11-24 22:33:18 (GMT)
commitcda85a0d1ca217c927211af799072c85b04b4e89 (patch)
tree9c39c7db7dadb3f5845002a27f56fb74c74eed6a /Doc/howto/urllib2.rst
parented92910852ad7a3006bc264ef6cb061868e5a82c (diff)
downloadcpython-cda85a0d1ca217c927211af799072c85b04b4e89.zip
cpython-cda85a0d1ca217c927211af799072c85b04b4e89.tar.gz
cpython-cda85a0d1ca217c927211af799072c85b04b4e89.tar.bz2
Issue #25576: Remove application/x-www-form-urlencoded charset advice
No charset parameter is standardized for this Content-Type value. Also clarify that urlencode() outputs ASCII.
Diffstat (limited to 'Doc/howto/urllib2.rst')
-rw-r--r--Doc/howto/urllib2.rst6
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()