{"action":"created","issue":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/3683","repository_url":"https://api.github.com/repos/kennethreitz/requests","labels_url":"https://api.github.com/repos/kennethreitz/requests/issues/3683/labels{/name}","comments_url":"https://api.github.com/repos/kennethreitz/requests/issues/3683/comments","events_url":"https://api.github.com/repos/kennethreitz/requests/issues/3683/events","html_url":"https://github.com/kennethreitz/requests/issues/3683","id":189411935,"number":3683,"title":"URL has an invalid label.","user":{"login":"MikeVL","id":118285,"avatar_url":"https://avatars.githubusercontent.com/u/118285?v=3","gravatar_id":"","url":"https://api.github.com/users/MikeVL","html_url":"https://github.com/MikeVL","followers_url":"https://api.github.com/users/MikeVL/followers","following_url":"https://api.github.com/users/MikeVL/following{/other_user}","gists_url":"https://api.github.com/users/MikeVL/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeVL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeVL/subscriptions","organizations_url":"https://api.github.com/users/MikeVL/orgs","repos_url":"https://api.github.com/users/MikeVL/repos","events_url":"https://api.github.com/users/MikeVL/events{/privacy}","received_events_url":"https://api.github.com/users/MikeVL/received_events","type":"User","site_admin":false},"labels":[{"id":167537670,"url":"https://api.github.com/repos/kennethreitz/requests/labels/Propose%20Close","name":"Propose Close","color":"f7c6c7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-15T14:50:57Z","updated_at":"2016-11-15T16:41:09Z","closed_at":"2016-11-15T15:07:41Z","body":"requests v2.12.0\r\n```python\r\n>>> import requests\r\n>>> requests.get('http://vluki_develop_624_solr:8983/solr/vluki')\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 70, in get\r\n    return request('get', url, params=params, **kwargs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 56, in request\r\n    return session.request(method=method, url=url, **kwargs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 474, in request\r\n    prep = self.prepare_request(req)\r\n  File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 407, in prepare_request\r\n    hooks=merge_hooks(request.hooks, self.hooks),\r\n  File \"/usr/local/lib/python2.7/dist-packages/requests/models.py\", line 302, in prepare\r\n    self.prepare_url(url, params)\r\n  File \"/usr/local/lib/python2.7/dist-packages/requests/models.py\", line 372, in prepare_url\r\n    raise InvalidURL('URL has an invalid label.')\r\nrequests.exceptions.InvalidURL: URL has an invalid label.\r\n```"},"comment":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/comments/260694543","html_url":"https://github.com/kennethreitz/requests/issues/3683#issuecomment-260694543","issue_url":"https://api.github.com/repos/kennethreitz/requests/issues/3683","id":260694543,"user":{"login":"Lothiraldan","id":243665,"avatar_url":"https://avatars.githubusercontent.com/u/243665?v=3","gravatar_id":"","url":"https://api.github.com/users/Lothiraldan","html_url":"https://github.com/Lothiraldan","followers_url":"https://api.github.com/users/Lothiraldan/followers","following_url":"https://api.github.com/users/Lothiraldan/following{/other_user}","gists_url":"https://api.github.com/users/Lothiraldan/gists{/gist_id}","starred_url":"https://api.github.com/users/Lothiraldan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lothiraldan/subscriptions","organizations_url":"https://api.github.com/users/Lothiraldan/orgs","repos_url":"https://api.github.com/users/Lothiraldan/repos","events_url":"https://api.github.com/users/Lothiraldan/events{/privacy}","received_events_url":"https://api.github.com/users/Lothiraldan/received_events","type":"User","site_admin":false},"created_at":"2016-11-15T16:41:09Z","updated_at":"2016-11-15T16:41:09Z","body":"We encountered the same issue today and comes to the same conclusion that they are not officially supported. In our situation, we tried to use the devpi CLI against a docker image with the hostname `infrastructure_pythondevpi_1`. The hostname was auto-generated by docker-compose with its own algorithm which is more or less: `PWD-NAME_SERVICE-NAME_NUMBER`. The issue is well-known but not yet fixed: https://github.com/docker/compose/issues/229.\r\n\r\nWe downgraded requests to bypass the problem.\r\n\r\nWhile underscores are not officially support it seems that both Firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=479520#c45) and curl seems to works well with underscores:\r\n\r\n```curl -I http://infrastructure_pythondevpi_1:3141/root/staging/+api\r\nHTTP/1.1 200 OK\r\nConnection: close\r\nContent-Type: application/json\r\nDate: Tue, 15 Nov 2016 16:36:40 GMT\r\n```\r\n\r\nI didn't saw any option in the idna library to accept these characters, so apart from avoiding requests>2.12.0 when having underscore hostnames, we have no choices, right?"}}
{"actor":{"display_login":"Lothiraldan"}}