This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: http_proxy on windows won't function due to incorrect case handling
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.1, Python 3.2, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, chris.nojima
Priority: normal Keywords:

Created on 2011-03-04 18:35 by chris.nojima, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg130067 - (view) Author: chris nojima (chris.nojima) Date: 2011-03-04 18:35
There is an issue where on windows os.environ keys are all uppercase. If i run set a="hello", in python it will appear as a key "A". urllib.request.getproxies_environment looks for all _proxy environment vars by looking for "_proxy". Since windows uppercases, it's impossible to set this var (it will be HTTP_PROXY and won't match, etc).
This is stopping me from running some install scripts
msg130087 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2011-03-04 23:38
hmm, the code of urllib.request.getproxies_environment contains::
    for name, value in os.environ.items():
        name = name.lower()
        if value and name[-6:] == '_proxy':
            proxies[name[:-6]] = value  
So the comparison is effectively case-insensitive.
What is the problem exactly?
msg130123 - (view) Author: chris nojima (chris.nojima) Date: 2011-03-05 16:33
Sorry. You are correct, this must have been fixed in 3.1.2. The box I was on had 3.1.1 on it and some other configuration issues led me to believe this was happening in 3.2 as well.
History
Date User Action Args
2022-04-11 14:57:13adminsetgithub: 55607
2011-03-05 16:33:08chris.nojimasetstatus: open -> closed

messages: + msg130123
resolution: fixed
2011-03-04 23:38:00amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg130087
2011-03-04 18:35:10chris.nojimacreate