New submission from Ronald Oussoren <ronaldousso...@mac.com>:

The proxy support code in urllib is imho too specific and cannot easily support 
dynamic proxy configuration using a proxy.pac file.

That is, the code assumes that there is at most one proxy per protocol, while 
this is not quite true in practice.  A proxy.pac can refer different URLs to 
different proxies (or exclude some from proxying).

This could be solved by adding a new proxy hook to urllib, something like:

def getproxies_for_url(url) -> [info, ...]

That is, the argument is the string for an URL, the result is a list of proxies 
that can be used to fetch the URL.

This hook would allow us to provide a hook on OSX that enables python scripts 
to use the system proxy settings, even when those are complex (such as by using 
proxy autoconfiguration).

----------
components: Library (Lib)
messages: 100573
nosy: ronaldoussoren
severity: normal
stage: needs patch
status: open
title: urllib proxy interface is too limited
type: feature request
versions: Python 2.7, Python 3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8083>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to