[docs] [issue9637] docs do not say that urllib uses HTTP_PROXY

Kirikaza report at bugs.python.org
Fri Aug 20 21:41:16 CEST 2010


Kirikaza <kirikaza at rambler.ru> added the comment:

> Are you talking about ...
I have read no line of code from urllib module. I just try to use urllib.urlopen() and I see it uses not only http_proxy but also HTTP_PROXY and urlopen() prefers the latter variable.

Let's consider a two-lines sample proxy.py:
import urllib
urllib.urlopen('http://python.org/ftp/').readlines()

Some tests:

$ http_proxy= HTTP_PROXY= proxy.py
['<!DOCTYPE HTML ... \n']

$ http_proxy=lower:80 HTTP_PROXY= proxy.py
IOError: invalid proxy for http: 'lower:80'

$ http_proxy= HTTP_PROXY=UPPER:80 proxy.py
IOError: invalid proxy for http: 'UPPER:80'

$ http_proxy=lower:80 HTTP_PROXY=UPPER:80 proxy.py
IOError: invalid proxy for http: 'UPPER:80'

> a specific change in a specific place
place: 20.5.1, paragraph 7 (the only one where *_proxy are discussed)
change: add some words about HTTP_PROXY and maybe about FTP_PROXY

> does urllib2.urlopen ... (in 3.x)
I don't have Python 3.x so I can't say anything.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9637>
_______________________________________


More information about the docs mailing list