@@ -173,15 +173,15 @@ The :mod:`urllib.request` module defines the following functions:
173173 If both lowercase and uppercase environment variables exist (and disagree),
174174 lowercase is preferred.
175175
176- .. note ::
176+ .. note ::
177177
178- If the environment variable ``REQUEST_METHOD `` is set, which usually
179- indicates your script is running in a CGI environment, the environment
180- variable ``HTTP_PROXY `` (uppercase ``_PROXY ``) will be ignored. This is
181- because that variable can be injected by a client using the "Proxy:" HTTP
182- header. If you need to use an HTTP proxy in a CGI environment, either use
183- ``ProxyHandler `` explicitly, or make sure the variable name is in
184- lowercase (or at least the ``_proxy `` suffix).
178+ If the environment variable ``REQUEST_METHOD `` is set, which usually
179+ indicates your script is running in a CGI environment, the environment
180+ variable ``HTTP_PROXY `` (uppercase ``_PROXY ``) will be ignored. This is
181+ because that variable can be injected by a client using the "Proxy:" HTTP
182+ header. If you need to use an HTTP proxy in a CGI environment, either use
183+ ``ProxyHandler `` explicitly, or make sure the variable name is in
184+ lowercase (or at least the ``_proxy `` suffix).
185185
186186
187187The following classes are provided:
@@ -1388,48 +1388,48 @@ some point in the future.
13881388 :class: `URLopener ` objects will raise an :exc: `OSError ` exception if the server
13891389 returns an error code.
13901390
1391- .. method :: open(fullurl, data=None)
1391+ .. method :: open(fullurl, data=None)
13921392
1393- Open *fullurl * using the appropriate protocol. This method sets up cache and
1394- proxy information, then calls the appropriate open method with its input
1395- arguments. If the scheme is not recognized, :meth: `open_unknown ` is called.
1396- The *data * argument has the same meaning as the *data * argument of
1397- :func: `urlopen `.
1393+ Open *fullurl * using the appropriate protocol. This method sets up cache and
1394+ proxy information, then calls the appropriate open method with its input
1395+ arguments. If the scheme is not recognized, :meth: `open_unknown ` is called.
1396+ The *data * argument has the same meaning as the *data * argument of
1397+ :func: `urlopen `.
13981398
13991399
1400- .. method :: open_unknown(fullurl, data=None)
1400+ .. method :: open_unknown(fullurl, data=None)
14011401
1402- Overridable interface to open unknown URL types.
1402+ Overridable interface to open unknown URL types.
14031403
14041404
1405- .. method :: retrieve(url, filename=None, reporthook=None, data=None)
1405+ .. method :: retrieve(url, filename=None, reporthook=None, data=None)
14061406
1407- Retrieves the contents of *url * and places it in *filename *. The return value
1408- is a tuple consisting of a local filename and either an
1409- :class: `email.message.Message ` object containing the response headers (for remote
1410- URLs) or ``None `` (for local URLs). The caller must then open and read the
1411- contents of *filename *. If *filename * is not given and the URL refers to a
1412- local file, the input filename is returned. If the URL is non-local and
1413- *filename * is not given, the filename is the output of :func: `tempfile.mktemp `
1414- with a suffix that matches the suffix of the last path component of the input
1415- URL. If *reporthook * is given, it must be a function accepting three numeric
1416- parameters: A chunk number, the maximum size chunks are read in and the total size of the download
1417- (-1 if unknown). It will be called once at the start and after each chunk of data is read from the
1418- network. *reporthook * is ignored for local URLs.
1407+ Retrieves the contents of *url * and places it in *filename *. The return value
1408+ is a tuple consisting of a local filename and either an
1409+ :class: `email.message.Message ` object containing the response headers (for remote
1410+ URLs) or ``None `` (for local URLs). The caller must then open and read the
1411+ contents of *filename *. If *filename * is not given and the URL refers to a
1412+ local file, the input filename is returned. If the URL is non-local and
1413+ *filename * is not given, the filename is the output of :func: `tempfile.mktemp `
1414+ with a suffix that matches the suffix of the last path component of the input
1415+ URL. If *reporthook * is given, it must be a function accepting three numeric
1416+ parameters: A chunk number, the maximum size chunks are read in and the total size of the download
1417+ (-1 if unknown). It will be called once at the start and after each chunk of data is read from the
1418+ network. *reporthook * is ignored for local URLs.
14191419
1420- If the *url * uses the :file: `http: ` scheme identifier, the optional *data *
1421- argument may be given to specify a ``POST `` request (normally the request type
1422- is ``GET ``). The *data * argument must in standard
1423- :mimetype: `application/x-www-form-urlencoded ` format; see the
1424- :func: `urllib.parse.urlencode ` function.
1420+ If the *url * uses the :file: `http: ` scheme identifier, the optional *data *
1421+ argument may be given to specify a ``POST `` request (normally the request type
1422+ is ``GET ``). The *data * argument must in standard
1423+ :mimetype: `application/x-www-form-urlencoded ` format; see the
1424+ :func: `urllib.parse.urlencode ` function.
14251425
14261426
1427- .. attribute :: version
1427+ .. attribute :: version
14281428
1429- Variable that specifies the user agent of the opener object. To get
1430- :mod: `urllib ` to tell servers that it is a particular user agent, set this in a
1431- subclass as a class variable or in the constructor before calling the base
1432- constructor.
1429+ Variable that specifies the user agent of the opener object. To get
1430+ :mod: `urllib ` to tell servers that it is a particular user agent, set this in a
1431+ subclass as a class variable or in the constructor before calling the base
1432+ constructor.
14331433
14341434
14351435.. class :: FancyURLopener(...)
0 commit comments