summaryrefslogtreecommitdiffstats
path: root/Doc/howto
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-04-28 15:16:21 (GMT)
committerR David Murray <rdmurray@bitdance.com>2013-04-28 15:16:21 (GMT)
commit806c1c939d6d4ba6e71c7e72c84e991b70612f2b (patch)
treeede4a8c429680d19367ea0f10e49e2ba1dff8992 /Doc/howto
parent8118df7bd4447a82917fef86811111ca8aa7af6e (diff)
downloadcpython-806c1c939d6d4ba6e71c7e72c84e991b70612f2b.zip
cpython-806c1c939d6d4ba6e71c7e72c84e991b70612f2b.tar.gz
cpython-806c1c939d6d4ba6e71c7e72c84e991b70612f2b.tar.bz2
#7152: Clarify that ProxyHandler is added only if proxy settings are detected.
Behavior confirmation and initial patch by Jessica McKellar.
Diffstat (limited to 'Doc/howto')
-rw-r--r--Doc/howto/urllib2.rst8
1 files changed, 5 insertions, 3 deletions
diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst
index a855308..0291c68 100644
--- a/Doc/howto/urllib2.rst
+++ b/Doc/howto/urllib2.rst
@@ -489,9 +489,10 @@ than the URL you pass to .add_password() will also match. ::
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 setting such as an :envvar:`http_proxy`
+ environment variable 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)
@@ -506,7 +507,8 @@ Proxies
=======
**urllib2** 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
+the ``ProxyHandler``, which is part of the normal handler chain when a proxy
+setting is detected. 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 : ::