Repository: conda/conda

Issue:
Bad interpreation of null in proxy_servers section in .condarc since ver. 4.2.13
Upon upgrade to conda to version 4.2.13 the following settings in .condarc, which were meant to unset any http_proxy or https_proxy variables no longer work; result in HTTP error.

```
proxy_servers:
    # Unset proxies so we can define internal channels shouldn't go outside anyway
    http:
    https:
```
Error received upon conda install:

```
An HTTP error occurred when trying to retrieve this URL.
ConnectionError(MaxRetryError("HTTPConnectionPool(host=u'None', port=80): Max retries exceeded with url: http://sfp-inf.jpmchase.net:9000/conda/mrad/channel/dev/linux-64/repodata.json (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f197d701610>: Failed to establish a new connection: [Errno -2] Name or service not known',)))",),)
```

The reason is wrongly reinterpreting null values as 'None' string and subsequently trying to connect to hostname 'None'.

For those of you need a workaround now, change your .condarc as follows:

```
proxy_servers:
    # Unset proxies so we can define internal channels shouldn't go outside anyway
    http: ""
    https: ""
```

Bad interpreation of null in proxy_servers section in .condarc since ver. 4.2.13
Upon upgrade to conda to version 4.2.13 the following settings in .condarc, which were meant to unset any http_proxy or https_proxy variables no longer work; result in HTTP error.

```
proxy_servers:
    # Unset proxies so we can define internal channels shouldn't go outside anyway
    http:
    https:
```
Error received upon conda install:

```
An HTTP error occurred when trying to retrieve this URL.
ConnectionError(MaxRetryError("HTTPConnectionPool(host=u'None', port=80): Max retries exceeded with url: http://sfp-inf.jpmchase.net:9000/conda/mrad/channel/dev/linux-64/repodata.json (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f197d701610>: Failed to establish a new connection: [Errno -2] Name or service not known',)))",),)
```

The reason is wrongly reinterpreting null values as 'None' string and subsequently trying to connect to hostname 'None'.

For those of you need a workaround now, change your .condarc as follows:

```
proxy_servers:
    # Unset proxies so we can define internal channels shouldn't go outside anyway
    http: ""
    https: ""
```



Discussion:
Sounds similar to what @nehaljwani fixed in https://github.com/conda/conda/pull/5096
Sounds similar to what @nehaljwani fixed in https://github.com/conda/conda/pull/5096

Resolving patch:
diff --git a/conda/base/context.py b/conda/base/context.py
--- a/conda/base/context.py
+++ b/conda/base/context.py
@@ -107,7 +107,7 @@ class Context(Configuration):
                                          element_type=string_types + (NoneType,))
     client_ssl_cert_key = PrimitiveParameter(None, aliases=('client_cert_key',),
                                              element_type=string_types + (NoneType,))
-    proxy_servers = MapParameter(string_types)
+    proxy_servers = MapParameter(string_types + (NoneType,))
     remote_connect_timeout_secs = PrimitiveParameter(9.15)
     remote_read_timeout_secs = PrimitiveParameter(60.)
     remote_max_retries = PrimitiveParameter(3)


Test patch:
diff --git a/tests/base/test_context.py b/tests/base/test_context.py
--- a/tests/base/test_context.py
+++ b/tests/base/test_context.py
@@ -45,6 +45,13 @@ def setUp(self):
         channel_alias: ftp://new.url:8082
         conda-build:
           root-dir: /some/test/path
+        proxy_servers:
+          http: http://user:pass@corp.com:8080
+          https: none
+          ftp:
+          sftp: ''
+          ftps: false
+          rsync: 'false'
         """)
         reset_context()
         rd = odict(testdata=YamlRawParameter.make_raw_parameters('testdata', yaml_load(string)))
@@ -157,6 +164,14 @@ def test_custom_multichannels(self):
             Channel('learn_from_every_thing'),
         )
 
+    def test_proxy_servers(self):
+        assert context.proxy_servers['http'] == 'http://user:pass@corp.com:8080'
+        assert context.proxy_servers['https'] is None
+        assert context.proxy_servers['ftp'] is None
+        assert context.proxy_servers['sftp'] == ''
+        assert context.proxy_servers['ftps'] == 'False'
+        assert context.proxy_servers['rsync'] == 'False'
+
     def test_conda_build_root_dir(self):
         assert context.conda_build['root-dir'] == "/some/test/path"
         from conda.config import rc