Several issues with urllib/urllib2 documentation regarding proxy usage: 1. The Macintosh proxy description in section 21.5.1 is out-of-date: "In a Macintosh environment, urlopen() will retrieve proxy information from Internet Config." Suggest something like: "In a Mac OS X environment, urlopen() will retrieve proxy information from the OS X System Configuration framework, which can be managed with the Network system preference panel." 2. In general, urllib/urllib2 on Python 2 and urllib.request on Python 3 are supposed to default to using the OS's proxy configuration on Windows and OS X if not overridden by environment variables or if not supplied as an argument. This is described in python 2 docs section 21.5.1. urllib2 has the same default behavior since under the covers it uses urllib's proxy functions. But that behavior is not documented in 21.6 for urllib2 in the various spots where proxy is mentioned. 3. Likewise, the corresponding sections of the Python 3 documentation for urllib.request (section 20.5) do not mention the default system proxy configuration behavior and should since that code was carried over from Python 2 (although, at the moment, the OS X code is broken - see Issue7154).
I have attached a docs patch against the trunk. Please provide your review comments. If its okay, I can commit it and have the information (urllib2.rst) for the Python 3k too.
One comment: + :envvar:`_proxy`. In a Windows environment, if no proxy + environment variables are set, proxy settings are obtained from the + registry's Internet Settings section. In a Mac OS X environment, proxy + information is retrieved from from the OS X System Configuration Framework. The "if no proxy environment variables are set" part applies to OS X as well so perhaps: If no proxy environment variables are set, in a Windows environment ... and in a Mac OS X environment ... . Otherwise looks good. Thanks!
Thanks for the comments. Fixed and committed the changes trunk - 75478. and merged into release26-maint - 75479. py3k - r75476 release31-maint - r75477
History
Date
User
Action
Args
2022-04-11 14:56:54
admin
set
github: 51404
2009-10-18 02:02:10
orsenthil
set
status: open -> closedresolution: accepted -> fixedmessages: +