@@ -170,15 +170,15 @@ The :mod:`urllib.request` module defines the following functions:
170170 If both lowercase and uppercase environment variables exist (and disagree),
171171 lowercase is preferred.
172172
173- .. note ::
173+ .. note ::
174174
175- If the environment variable ``REQUEST_METHOD `` is set, which usually
176- indicates your script is running in a CGI environment, the environment
177- variable ``HTTP_PROXY `` (uppercase ``_PROXY ``) will be ignored. This is
178- because that variable can be injected by a client using the "Proxy:" HTTP
179- header. If you need to use an HTTP proxy in a CGI environment, either use
180- ``ProxyHandler `` explicitly, or make sure the variable name is in
181- lowercase (or at least the ``_proxy `` suffix).
175+ If the environment variable ``REQUEST_METHOD `` is set, which usually
176+ indicates your script is running in a CGI environment, the environment
177+ variable ``HTTP_PROXY `` (uppercase ``_PROXY ``) will be ignored. This is
178+ because that variable can be injected by a client using the "Proxy:" HTTP
179+ header. If you need to use an HTTP proxy in a CGI environment, either use
180+ ``ProxyHandler `` explicitly, or make sure the variable name is in
181+ lowercase (or at least the ``_proxy `` suffix).
182182
183183
184184The following classes are provided:
@@ -1407,48 +1407,48 @@ some point in the future.
14071407 :class: `URLopener ` objects will raise an :exc: `OSError ` exception if the server
14081408 returns an error code.
14091409
1410- .. method :: open(fullurl, data=None)
1410+ .. method :: open(fullurl, data=None)
14111411
1412- Open *fullurl * using the appropriate protocol. This method sets up cache and
1413- proxy information, then calls the appropriate open method with its input
1414- arguments. If the scheme is not recognized, :meth: `open_unknown ` is called.
1415- The *data * argument has the same meaning as the *data * argument of
1416- :func: `urlopen `.
1412+ Open *fullurl * using the appropriate protocol. This method sets up cache and
1413+ proxy information, then calls the appropriate open method with its input
1414+ arguments. If the scheme is not recognized, :meth: `open_unknown ` is called.
1415+ The *data * argument has the same meaning as the *data * argument of
1416+ :func: `urlopen `.
14171417
14181418
1419- .. method :: open_unknown(fullurl, data=None)
1419+ .. method :: open_unknown(fullurl, data=None)
14201420
1421- Overridable interface to open unknown URL types.
1421+ Overridable interface to open unknown URL types.
14221422
14231423
1424- .. method :: retrieve(url, filename=None, reporthook=None, data=None)
1424+ .. method :: retrieve(url, filename=None, reporthook=None, data=None)
14251425
1426- Retrieves the contents of *url * and places it in *filename *. The return value
1427- is a tuple consisting of a local filename and either an
1428- :class: `email.message.Message ` object containing the response headers (for remote
1429- URLs) or ``None `` (for local URLs). The caller must then open and read the
1430- contents of *filename *. If *filename * is not given and the URL refers to a
1431- local file, the input filename is returned. If the URL is non-local and
1432- *filename * is not given, the filename is the output of :func: `tempfile.mktemp `
1433- with a suffix that matches the suffix of the last path component of the input
1434- URL. If *reporthook * is given, it must be a function accepting three numeric
1435- parameters: A chunk number, the maximum size chunks are read in and the total size of the download
1436- (-1 if unknown). It will be called once at the start and after each chunk of data is read from the
1437- network. *reporthook * is ignored for local URLs.
1426+ Retrieves the contents of *url * and places it in *filename *. The return value
1427+ is a tuple consisting of a local filename and either an
1428+ :class: `email.message.Message ` object containing the response headers (for remote
1429+ URLs) or ``None `` (for local URLs). The caller must then open and read the
1430+ contents of *filename *. If *filename * is not given and the URL refers to a
1431+ local file, the input filename is returned. If the URL is non-local and
1432+ *filename * is not given, the filename is the output of :func: `tempfile.mktemp `
1433+ with a suffix that matches the suffix of the last path component of the input
1434+ URL. If *reporthook * is given, it must be a function accepting three numeric
1435+ parameters: A chunk number, the maximum size chunks are read in and the total size of the download
1436+ (-1 if unknown). It will be called once at the start and after each chunk of data is read from the
1437+ network. *reporthook * is ignored for local URLs.
14381438
1439- If the *url * uses the :file: `http: ` scheme identifier, the optional *data *
1440- argument may be given to specify a ``POST `` request (normally the request type
1441- is ``GET ``). The *data * argument must in standard
1442- :mimetype: `application/x-www-form-urlencoded ` format; see the
1443- :func: `urllib.parse.urlencode ` function.
1439+ If the *url * uses the :file: `http: ` scheme identifier, the optional *data *
1440+ argument may be given to specify a ``POST `` request (normally the request type
1441+ is ``GET ``). The *data * argument must in standard
1442+ :mimetype: `application/x-www-form-urlencoded ` format; see the
1443+ :func: `urllib.parse.urlencode ` function.
14441444
14451445
1446- .. attribute :: version
1446+ .. attribute :: version
14471447
1448- Variable that specifies the user agent of the opener object. To get
1449- :mod: `urllib ` to tell servers that it is a particular user agent, set this in a
1450- subclass as a class variable or in the constructor before calling the base
1451- constructor.
1448+ Variable that specifies the user agent of the opener object. To get
1449+ :mod: `urllib ` to tell servers that it is a particular user agent, set this in a
1450+ subclass as a class variable or in the constructor before calling the base
1451+ constructor.
14521452
14531453
14541454.. class :: FancyURLopener(...)
0 commit comments