mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Merge #7152: Clarify that ProxyHandler is added only if proxy settings are detected.
Behavior confirmation and initial patch by Jessica McKellar.
This commit is contained in:
commit
876f08e3ae
3 changed files with 15 additions and 9 deletions
|
@ -504,9 +504,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)
|
||||
|
@ -521,7 +522,8 @@ Proxies
|
|||
=======
|
||||
|
||||
**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
|
||||
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 : ::
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue