# HG changeset patch # User Edouard Gomez # Date 1123608994 28800 # Node ID 6390c377a9e617e01061d33f3729948d72b6f54f # Parent c333dfa8fa1ab7fafdd99e4989a77b198fb04b59 Trap OSError when deleting env vars On the other OS, it seems that case insensitivity for environment vars can bite users when using some unknown combination of python 2.4.1 and win2kSP4+minsys (and probably other vversions of these softwares). The best way to avoid problems in those weird cases is to ignore OSError exception during env var deletion. diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -1781,8 +1781,11 @@ class httprepository: # Note: urllib2 takes proxy values from the environment and those will # take precedence for env in ["HTTP_PROXY", "http_proxy", "no_proxy"]: - if os.environ.has_key(env): - del os.environ[env] + try: + if os.environ.has_key(env): + del os.environ[env] + except OSError: + pass proxy_handler = urllib2.BaseHandler() if host and not no_proxy: