summaryrefslogtreecommitdiff
path: root/Doc/howto/urllib2.rst
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-05-10 12:01:23 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2016-05-10 12:01:23 +0300
commit1ff27f48c8abad157c51cd4ec6ce6ea4a695fa1b (patch)
tree48fcbd15465e1d9844defb67f3aa83c8be0a8b33 /Doc/howto/urllib2.rst
parent48a4f092fcd3459990bec7857122dace8070b245 (diff)
downloadcpython-1ff27f48c8abad157c51cd4ec6ce6ea4a695fa1b.tar.gz
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 b4e2157dc5..24a415604f 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)