summaryrefslogtreecommitdiffstats
path: root/Doc/howto/urllib2.rst
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-05-10 09:01:23 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-05-10 09:01:23 (GMT)
commitdba903993a8d3e13d2cf83d6a8912e908025b17b (patch)
treeb0f7d957452d40ce384e5d0a1382067e3379f60f /Doc/howto/urllib2.rst
parent387235085c5a6a1d823b0af3fabb42830c88f984 (diff)
downloadcpython-dba903993a8d3e13d2cf83d6a8912e908025b17b.zip
cpython-dba903993a8d3e13d2cf83d6a8912e908025b17b.tar.gz
cpython-dba903993a8d3e13d2cf83d6a8912e908025b17b.tar.bz2
Issue #23921: Standardized documentation whitespace formatting.
Original patch by James Edwards.
Diffstat (limited to 'Doc/howto/urllib2.rst')
-rw-r--r--Doc/howto/urllib2.rst12
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst
index b4e2157..24a4156 100644
--- a/Doc/howto/urllib2.rst
+++ b/Doc/howto/urllib2.rst
@@ -175,10 +175,10 @@ Explorer [#]_. ::
url = 'http://www.someserver.com/cgi-bin/register.cgi'
user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'
- values = {'name' : 'Michael Foord',
- 'location' : 'Northampton',
- 'language' : 'Python' }
- headers = { 'User-Agent' : user_agent }
+ values = {'name': 'Michael Foord',
+ 'location': 'Northampton',
+ 'language': 'Python' }
+ headers = {'User-Agent': user_agent}
data = urllib.parse.urlencode(values)
data = data.encode('ascii')
@@ -215,7 +215,7 @@ e.g. ::
>>> req = urllib.request.Request('http://www.pretend_server.org')
>>> try: urllib.request.urlopen(req)
... except urllib.error.URLError as e:
- ... print(e.reason) #doctest: +SKIP
+ ... print(e.reason) #doctest: +SKIP
...
(4, 'getaddrinfo failed')
@@ -372,7 +372,7 @@ Number 2
::
from urllib.request import Request, urlopen
- from urllib.error import URLError
+ from urllib.error import URLError
req = Request(someurl)
try:
response = urlopen(req)