@@ -194,11 +194,11 @@ which comes after we have a look at what happens when things go wrong.
194194Handling Exceptions
195195===================
196196
197- *urlopen * raises :exc: `URLError ` when it cannot handle a response (though as
197+ *urlopen * raises :exc: `~urllib.error. URLError ` when it cannot handle a response (though as
198198usual with Python APIs, built-in exceptions such as :exc: `ValueError `,
199199:exc: `TypeError ` etc. may also be raised).
200200
201- :exc: `HTTPError ` is the subclass of :exc: `URLError ` raised in the specific case of
201+ :exc: `~urllib.error. HTTPError ` is the subclass of :exc: `~urllib.error. URLError ` raised in the specific case of
202202HTTP URLs.
203203
204204The exception classes are exported from the :mod: `urllib.error ` module.
@@ -229,12 +229,12 @@ the status code indicates that the server is unable to fulfil the request. The
229229default handlers will handle some of these responses for you (for example, if
230230the response is a "redirection" that requests the client fetch the document from
231231a different URL, urllib will handle that for you). For those it can't handle,
232- urlopen will raise an :exc: `HTTPError `. Typical errors include '404' (page not
232+ urlopen will raise an :exc: `~urllib.error. HTTPError `. Typical errors include '404' (page not
233233found), '403' (request forbidden), and '401' (authentication required).
234234
235235See section 10 of :rfc: `2616 ` for a reference on all the HTTP error codes.
236236
237- The :exc: `HTTPError ` instance raised will have an integer 'code' attribute, which
237+ The :exc: `~urllib.error. HTTPError ` instance raised will have an integer 'code' attribute, which
238238corresponds to the error sent by the server.
239239
240240Error Codes
@@ -317,7 +317,7 @@ dictionary is reproduced here for convenience ::
317317 }
318318
319319When an error is raised the server responds by returning an HTTP error code
320- *and * an error page. You can use the :exc: `HTTPError ` instance as a response on the
320+ *and * an error page. You can use the :exc: `~urllib.error. HTTPError ` instance as a response on the
321321page returned. This means that as well as the code attribute, it also has read,
322322geturl, and info, methods as returned by the ``urllib.response `` module::
323323
@@ -338,7 +338,7 @@ geturl, and info, methods as returned by the ``urllib.response`` module::
338338Wrapping it Up
339339--------------
340340
341- So if you want to be prepared for :exc: `HTTPError ` *or * :exc: `URLError ` there are two
341+ So if you want to be prepared for :exc: `~urllib.error. HTTPError ` *or * :exc: `~urllib.error. URLError ` there are two
342342basic approaches. I prefer the second approach.
343343
344344Number 1
@@ -365,7 +365,7 @@ Number 1
365365.. note ::
366366
367367 The ``except HTTPError `` *must * come first, otherwise ``except URLError ``
368- will *also * catch an :exc: `HTTPError `.
368+ will *also * catch an :exc: `~urllib.error. HTTPError `.
369369
370370Number 2
371371~~~~~~~~
@@ -391,7 +391,7 @@ Number 2
391391info and geturl
392392===============
393393
394- The response returned by urlopen (or the :exc: `HTTPError ` instance) has two
394+ The response returned by urlopen (or the :exc: `~urllib.error. HTTPError ` instance) has two
395395useful methods :meth: `info ` and :meth: `geturl ` and is defined in the module
396396:mod: `urllib.response `..
397397
0 commit comments