{"action":"created","issue":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/2703","labels_url":"https://api.github.com/repos/kennethreitz/requests/issues/2703/labels{/name}","comments_url":"https://api.github.com/repos/kennethreitz/requests/issues/2703/comments","events_url":"https://api.github.com/repos/kennethreitz/requests/issues/2703/events","html_url":"https://github.com/kennethreitz/requests/issues/2703","id":98864415,"number":2703,"title":"Broken parsing of authenticated URI for Proxy","user":{"login":"kharmalord","id":1562904,"avatar_url":"https://avatars.githubusercontent.com/u/1562904?v=3","gravatar_id":"","url":"https://api.github.com/users/kharmalord","html_url":"https://github.com/kharmalord","followers_url":"https://api.github.com/users/kharmalord/followers","following_url":"https://api.github.com/users/kharmalord/following{/other_user}","gists_url":"https://api.github.com/users/kharmalord/gists{/gist_id}","starred_url":"https://api.github.com/users/kharmalord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kharmalord/subscriptions","organizations_url":"https://api.github.com/users/kharmalord/orgs","repos_url":"https://api.github.com/users/kharmalord/repos","events_url":"https://api.github.com/users/kharmalord/events{/privacy}","received_events_url":"https://api.github.com/users/kharmalord/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-04T00:38:50Z","updated_at":"2015-08-04T16:04:06Z","closed_at":null,"body":"Opening issue (appears to be related to issue https://github.com/kennethreitz/requests/issues/1856) as this issue is still breaking for me.\r\n\r\nWhen I run the following it breaks:\r\n\r\n>>> import requests\r\n>>> url = \"http://sitereview.bluecoat.com/rest/categorization\"\r\n>>> data = {'url':'google.com'}\r\n>>> proxy = { \"http\": \"http://test.username:testp@ssword#@proxy.url.com:8080\"}\r\n>>> header = {'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:33.0) Gecko/20100101 Firefox/33.0'}\r\n>>> request = requests.post(url, proxies=proxy, headers=header, data=data)\r\n\r\nThe error it is giving is as follows:\r\n\r\nrequests.exceptions.ConnectionError: HTTPConnectionPool(host='ssword', port=80): Max retries exceeded with url: http://sitereview.bluecoat.com/rest/categorization (Caused by ProxyError('Cannot connect to proxy.', gaierror(-2, 'Name or service not known')))\r\n\r\nIf I change the password over to testp@ssword instead of testp@ssword# it works just fine.\r\n\r\nIt may be that I am rather new but I would appreciate any help or insight you can provide."},"comment":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/comments/127659810","html_url":"https://github.com/kennethreitz/requests/issues/2703#issuecomment-127659810","issue_url":"https://api.github.com/repos/kennethreitz/requests/issues/2703","id":127659810,"user":{"login":"kharmalord","id":1562904,"avatar_url":"https://avatars.githubusercontent.com/u/1562904?v=3","gravatar_id":"","url":"https://api.github.com/users/kharmalord","html_url":"https://github.com/kharmalord","followers_url":"https://api.github.com/users/kharmalord/followers","following_url":"https://api.github.com/users/kharmalord/following{/other_user}","gists_url":"https://api.github.com/users/kharmalord/gists{/gist_id}","starred_url":"https://api.github.com/users/kharmalord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kharmalord/subscriptions","organizations_url":"https://api.github.com/users/kharmalord/orgs","repos_url":"https://api.github.com/users/kharmalord/repos","events_url":"https://api.github.com/users/kharmalord/events{/privacy}","received_events_url":"https://api.github.com/users/kharmalord/received_events","type":"User","site_admin":false},"created_at":"2015-08-04T16:04:06Z","updated_at":"2015-08-04T16:04:06Z","body":"Alright so I was able to get this clean by adding the following to the password before it is put inside the proxies variable that gets passed to request:\r\n\r\nclean_pass = urllib.quote_plus(password)\r\n\r\nI found that quote_plus worked more effectively than urlencode as urlencode was throwing errors on the password with the error of \"TypeError: not a valid non-string sequence or mapping object\". \r\n\r\nJust know that quote_plus worked for me. It may give you folks a better possible solution (who knows)."}}