{"action":"created","issue":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/3734","repository_url":"https://api.github.com/repos/kennethreitz/requests","labels_url":"https://api.github.com/repos/kennethreitz/requests/issues/3734/labels{/name}","comments_url":"https://api.github.com/repos/kennethreitz/requests/issues/3734/comments","events_url":"https://api.github.com/repos/kennethreitz/requests/issues/3734/events","html_url":"https://github.com/kennethreitz/requests/issues/3734","id":192590208,"number":3734,"title":"docker-py breaks with some configurations of Requests v2.12.2","user":{"login":"Lukasa","id":1382556,"avatar_url":"https://avatars.githubusercontent.com/u/1382556?v=3","gravatar_id":"","url":"https://api.github.com/users/Lukasa","html_url":"https://github.com/Lukasa","followers_url":"https://api.github.com/users/Lukasa/followers","following_url":"https://api.github.com/users/Lukasa/following{/other_user}","gists_url":"https://api.github.com/users/Lukasa/gists{/gist_id}","starred_url":"https://api.github.com/users/Lukasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lukasa/subscriptions","organizations_url":"https://api.github.com/users/Lukasa/orgs","repos_url":"https://api.github.com/users/Lukasa/repos","events_url":"https://api.github.com/users/Lukasa/events{/privacy}","received_events_url":"https://api.github.com/users/Lukasa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-30T15:10:21Z","updated_at":"2016-11-30T15:22:45Z","closed_at":null,"body":"Reported by @graingert.\r\n\r\nThe patch filed by @tiran in #3713 seems to have broken docker-py. They're using a custom URL scheme (`http+docker`), which we previously applied URL preparation to but now do not. This has therefore busted what they were up to in v2.12.2.\r\n\r\nI'm not immediately sure that we have a good way out of this. Prior to this patch docker-py users were *probably* at risk of encountering issues because the HTTP requests to the Docker API can be routed across unix domain sockets, which may entirely fail to contain hostnames and also fail to IDNA-encode. So I'm not sure that we don't need docker-py to route around this a different way."},"comment":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/comments/263900570","html_url":"https://github.com/kennethreitz/requests/issues/3734#issuecomment-263900570","issue_url":"https://api.github.com/repos/kennethreitz/requests/issues/3734","id":263900570,"user":{"login":"Lukasa","id":1382556,"avatar_url":"https://avatars.githubusercontent.com/u/1382556?v=3","gravatar_id":"","url":"https://api.github.com/users/Lukasa","html_url":"https://github.com/Lukasa","followers_url":"https://api.github.com/users/Lukasa/followers","following_url":"https://api.github.com/users/Lukasa/following{/other_user}","gists_url":"https://api.github.com/users/Lukasa/gists{/gist_id}","starred_url":"https://api.github.com/users/Lukasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lukasa/subscriptions","organizations_url":"https://api.github.com/users/Lukasa/orgs","repos_url":"https://api.github.com/users/Lukasa/repos","events_url":"https://api.github.com/users/Lukasa/events{/privacy}","received_events_url":"https://api.github.com/users/Lukasa/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T15:22:45Z","updated_at":"2016-11-30T15:22:45Z","body":"Heh, nevermind, I think I know what this is.\r\n\r\nThe *only* difference between the two Requests versions is this. In 2.12.1:\r\n\r\n```python\r\nPython 2.7.12 (default, Oct 13 2016, 13:16:42) \r\n[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.35)] on darwin\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import requests\r\n>>> r = requests.Request('GET', 'http+docker://localunixsocket/v1.24/images/create')\r\n>>> p = r.prepare()\r\n>>> p.url\r\n'http+docker://localunixsocket/v1.24/images/create'\r\n```\r\n\r\nIn 2.12.2\r\n\r\n```python\r\nPython 2.7.12 (default, Oct 13 2016, 13:16:42) \r\n[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.35)] on darwin\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import requests\r\n>>> r = requests.Request('GET', 'http+docker://localunixsocket/v1.24/images/create')\r\n>>> p = r.prepare()\r\n>>> p.url\r\nu'http+docker://localunixsocket/v1.24/images/create'\r\n```\r\n\r\nSpecifically, the issue is that when Requests processes the URL it ends up as a bytestring. When it does not, it ends up as whatever type was passed in: in the case of Python 3, unicode. That then trips something up lower down in the stack (probably in the docker-py adapter) which expects only bytes there."}}
{"actor":{"display_login":"Lukasa"}}