Proxies from environment parsing problem

Hello, I've faced with a stupid problem, in my Ubuntu 16.04 in `/etc/environment` I wrote http proxy with end with one invisible space char at the end: `http_proxy=http://1.2.3.4:8080 `,and of course I didn't notice it when I just copy past proxies for my machines. 

And then when I used `requests.get()` I get a strange error:

```
Traceback (most recent call last):
  File "./t.py", line 5, in <module>
    x = requests.get("http://test/api")
  File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 405, in send
    conn = self.get_connection(request.url, proxies)
  File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 303, in get_connection
    proxy_manager = self.proxy_manager_for(proxy)
  File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 197, in proxy_manager_for
    **proxy_kwargs)
  File "/usr/local/lib/python3.6/site-packages/urllib3/poolmanager.py", line 440, in proxy_from_url
    return ProxyManager(proxy_url=url, **kw)
  File "/usr/local/lib/python3.6/site-packages/urllib3/poolmanager.py", line 385, in __init__
    proxy = parse_url(proxy_url)
  File "/usr/local/lib/python3.6/site-packages/urllib3/util/url.py", line 199, in parse_url
    raise LocationParseError(url)
urllib3.exceptions.LocationParseError: Failed to parse: 1.2.3.4:8080 
```
And then I found out that problem with `getproxies()` from `urllib` which used by `requests` for getting proxies. 

**Maybe we can just `strip()` each proxy string? It will be conveniently.**

## Expected Result

{'http': 'http://1.2.3.4:8080'}

## Actual Result

{'http': 'http://1.2.3.4:8080 '}

I got the string which ends with one space

## Reproduction Steps

See above

## System Information

```
{
  "chardet": {
    "version": "3.0.4"
  },
  "cryptography": {
    "version": ""
  },
  "idna": {
    "version": "2.6"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.6.2"
  },
  "platform": {
    "release": "4.4.0-112-generic",
    "system": "Linux"
  },
  "pyOpenSSL": {
    "openssl_version": "",
    "version": null
  },
  "requests": {
    "version": "2.18.4"
  },
  "system_ssl": {
    "version": "1000207f"
  },
  "urllib3": {
    "version": "1.22"
  },
  "using_pyopenssl": false
}
```

Hi @th3mis, it does look like we could be a bit more tolerant of bad input here. We don't actually do much with the proxies dictionary before sending it, unless we preform a redirect. It might be possible to add some cleaning to what we're passed in the `send` function, but we want to make sure not to modify what users actually intended to send. I feel like leading and trailing whitespace *may* be safe to make assumptions about though.

@sigmavirus24 any thoughts on this? Would this be better handled at the urllib3 level?

Sligthly related, I am on Windows and my http_proxy is set as :
`set http_proxy="http://xx.xx.xx.xx/"`

The problem is that the quotes are actually retained in the variable name
```

>>> os.environ['https_proxy']
'"http://xx.xx.xx.xx:80/"'
```

This confuses requests. Stripping the quotes could be helpful.

> Sligthly related, I am on Windows and my http_proxy is set as :
> `set http_proxy="http://xx.xx.xx.xx/"`
> 
> The problem is that the quotes are actually retained in the variable name
> 
> ```
> 
> >>> os.environ['https_proxy']
> '"http://xx.xx.xx.xx:80/"'
> ```
> 
> This confuses requests. Stripping the quotes could be helpful.

hey man, you perfectly helped to locate my problem!!
requests kept raising the InvalidURL exception but I just could not locate the error. 
but when I run os.environ['https_proxy'], I found it returned '"http://xx.xx.xx.xx:80\rexport"', then I know this must be THE ERROR I had been looking for..
very stupid error..thanks a lot man!!

So as I see strip proxies was merged and this issue should be closed. Thanks. 🥳

Contrary to what is said, the code to strip whitespace from proxy was not merged. Quoting from the PR  :  

>  Xander Harris added 2 commits on 4 May 2018
> Xander Harris Add test for proxy url strip and strip proxy urls. #4613   6cb55e2
> Xander Harris  Merge branch 'master' into iss4613    08336ad
> @ghost ghost closed this on 4 May 2018
> @ghost ghost deleted the edwardtheharris:iss4613 branch on 4 May 2018 

There is no merging into master. It looks like a mistake. You can also checkout the code, you will see that there is no such test as "test_proxy_strip_spaces()"

Also, quoting from the same PR :  

> I'm not sure this is the right place to do this operation, but it does solve the problem. Or at least it passes the test that I wrote for it.

I worked on a similar issue, but I spent several days analysing the requests codebase to make sure that all paths where a proxy environment variable is read would go through my proposed change in #5441 . That's why I believe it is a better location to do any adjustment on the proxy setting that the PR #4626