diff options
author | R David Murray <rdmurray@bitdance.com> | 2013-04-28 15:08:27 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2013-04-28 15:08:27 (GMT) |
commit | 876f08e3ae9de32447c5dfae580693f0aaa1f17a (patch) | |
tree | 325aa08cd1748d8f7cffca05f8580f651140e5e2 /Doc/library/urllib.request.rst | |
parent | 337f9785fcfdc71fe2983c6264cbbe4c5e60aa62 (diff) | |
parent | 5aea37ad1dad0841ab6b5408156cff592fbfa310 (diff) | |
download | cpython-876f08e3ae9de32447c5dfae580693f0aaa1f17a.zip cpython-876f08e3ae9de32447c5dfae580693f0aaa1f17a.tar.gz cpython-876f08e3ae9de32447c5dfae580693f0aaa1f17a.tar.bz2 |
Merge #7152: Clarify that ProxyHandler is added only if proxy settings are detected.
Behavior confirmation and initial patch by Jessica McKellar.
Diffstat (limited to 'Doc/library/urllib.request.rst')
-rw-r--r-- | Doc/library/urllib.request.rst | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst index ef80a92..a027c53 100644 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -87,8 +87,10 @@ The :mod:`urllib.request` module defines the following functions: the default installed global :class:`OpenerDirector` uses :class:`UnknownHandler` to ensure this never happens). - In addition, default installed :class:`ProxyHandler` makes sure the requests - are handled through the proxy when they are set. + In addition, if proxy settings are detected (for example, when a ``*_proxy`` + environment variable like :envvar:`http_proxy` is set), + :class:`ProxyHandler` is default installed and makes sure the requests are + handled through the proxy. The legacy ``urllib.urlopen`` function from Python 2.6 and earlier has been discontinued; :func:`urllib.request.urlopen` corresponds to the old @@ -126,7 +128,8 @@ The :mod:`urllib.request` module defines the following functions: subclasses of :class:`BaseHandler` (in which case it must be possible to call the constructor without any parameters). Instances of the following classes will be in front of the *handler*\s, unless the *handler*\s contain them, - instances of them or subclasses of them: :class:`ProxyHandler`, + instances of them or subclasses of them: :class:`ProxyHandler` (if proxy + settings are detected), :class:`UnknownHandler`, :class:`HTTPHandler`, :class:`HTTPDefaultErrorHandler`, :class:`HTTPRedirectHandler`, :class:`FTPHandler`, :class:`FileHandler`, :class:`HTTPErrorProcessor`, :class:`DataHandler`. @@ -256,9 +259,9 @@ The following classes are provided: Cause requests to go through a proxy. If *proxies* is given, it must be a dictionary mapping protocol names to URLs of proxies. The default is to read the list of proxies from the environment variables :envvar:`<protocol>_proxy`. - If no proxy environment variables are set, in a Windows environment, proxy - settings are obtained from the registry's Internet Settings section and in a - Mac OS X environment, proxy information is retrieved from the OS X System + If no proxy environment variables are set, then in a Windows environment proxy + settings are obtained from the registry's Internet Settings section, and in a + Mac OS X environment proxy information is retrieved from the OS X System Configuration Framework. To disable autodetected proxy pass an empty dictionary. |