diff -r 4d4277941a45 Doc/howto/urllib2.rst --- a/Doc/howto/urllib2.rst Fri Apr 12 23:30:59 2013 +0300 +++ b/Doc/howto/urllib2.rst Sat Apr 13 13:55:42 2013 -0400 @@ -504,9 +504,10 @@ In the above example we only supplied our ``HTTPBasicAuthHandler`` to ``build_opener``. By default openers have the handlers for normal situations - -- ``ProxyHandler``, ``UnknownHandler``, ``HTTPHandler``, + -- ``ProxyHandler`` (if a ``*_proxy`` environment variable like + :envvar:`http_proxy` is set), ``UnknownHandler``, ``HTTPHandler``, ``HTTPDefaultErrorHandler``, ``HTTPRedirectHandler``, ``FTPHandler``, - ``FileHandler``, ``HTTPErrorProcessor``. + ``FileHandler``, ``DataHandler``, ``HTTPErrorProcessor``. ``top_level_url`` is in fact *either* a full URL (including the 'http:' scheme component and the hostname and optionally the port number) @@ -521,10 +522,12 @@ ======= **urllib** will auto-detect your proxy settings and use those. This is through -the ``ProxyHandler`` which is part of the normal handler chain. Normally that's -a good thing, but there are occasions when it may not be helpful [#]_. One way -to do this is to setup our own ``ProxyHandler``, with no proxies defined. This -is done using similar steps to setting up a `Basic Authentication`_ handler : :: +the ``ProxyHandler`` which is part of the normal handler chain when a +``*_proxy`` environment variable like :envvar:`http_proxy` is set. Normally +that's a good thing, but there are occasions when it may not be helpful +[#]_. One way to do this is to setup our own ``ProxyHandler``, with no proxies +defined. This is done using similar steps to setting up a `Basic +Authentication`_ handler : :: >>> proxy_support = urllib.request.ProxyHandler({}) >>> opener = urllib.request.build_opener(proxy_support) diff -r 4d4277941a45 Doc/library/urllib.request.rst --- a/Doc/library/urllib.request.rst Fri Apr 12 23:30:59 2013 +0300 +++ b/Doc/library/urllib.request.rst Sat Apr 13 13:55:42 2013 -0400 @@ -87,8 +87,9 @@ 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, 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