>>          if ui.config("http_proxy", "host"):
>>              for env in ["HTTP_PROXY", "http_proxy", "no_proxy"]:
>>                  try:
>> -                    if env in os.environ:
>> -                        del os.environ[env]
>> +                    if env in encoding.environ:
>> +                        del encoding.environ[env]
>>                  except OSError:
>>                      pass
>
> Here we have to pass new environ dict to urllib2 over the global os.environ
> dict. So we'll need to revisit this part later since encoding.environ can be
> a read-only copy of os.environ on Python 3.

We have two possible options,

1.  for env in [u"HTTP_PROXY", u"http_proxy", u"no_proxy"]:
                 try:
                    if env in os.environ:
                        del os.environ[env]

2. for env in ["HTTP_PROXY", "http_proxy", "no_proxy"]:
                 try:
                    if py3:
                        if env in os.environb:
                            del os.environb[env]
                    else:
                        if env in os.environ:
                            del os.environ[env]

IIUC encoding.environ everytimes goes into encoding.py, check those
conditions and returns a dictionary by reading os.environ or
os.environb. Or is it like every time we are reading(getting by
calling encoding.environ) the same dictionary.

If first argument is correct than any of these will work because
os.environ and os.environb are synchronised in python 3.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to