{"action":"created","issue":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/2699","labels_url":"https://api.github.com/repos/kennethreitz/requests/issues/2699/labels{/name}","comments_url":"https://api.github.com/repos/kennethreitz/requests/issues/2699/comments","events_url":"https://api.github.com/repos/kennethreitz/requests/issues/2699/events","html_url":"https://github.com/kennethreitz/requests/issues/2699","id":98258031,"number":2699,"title":"(Requests 2.7.0) getting error(115, 'Operation now in progress')) on connect","user":{"login":"offbyone","id":181693,"avatar_url":"https://avatars.githubusercontent.com/u/181693?v=3","gravatar_id":"","url":"https://api.github.com/users/offbyone","html_url":"https://github.com/offbyone","followers_url":"https://api.github.com/users/offbyone/followers","following_url":"https://api.github.com/users/offbyone/following{/other_user}","gists_url":"https://api.github.com/users/offbyone/gists{/gist_id}","starred_url":"https://api.github.com/users/offbyone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/offbyone/subscriptions","organizations_url":"https://api.github.com/users/offbyone/orgs","repos_url":"https://api.github.com/users/offbyone/repos","events_url":"https://api.github.com/users/offbyone/events{/privacy}","received_events_url":"https://api.github.com/users/offbyone/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2015-07-30T20:33:15Z","updated_at":"2015-07-30T21:25:23Z","closed_at":null,"body":"I'm receiving a strange connection error using Requests 2.7.0\r\nconnecting to an HTTP service as part of an integration test. Below is\r\nthe call stack when I call into `session.request` in the API (for\r\nreasons of NDA I can't provide the rest of the callstack).\r\n\r\nThe error is below in full detail, but in short, send() in requests is emitting `ConnectionError: ('Connection aborted.', error(115, 'Operation now in progress'))`\r\n\r\nPython=2.7\r\nRequests=2.7.0\r\n\r\n\r\nThe parameters being passed in to this are:\r\n\r\nverb=POST\r\nurl=(an HTTP url for an internal service)\r\ndata=(a dict)\r\nverify=False\r\ncert=None\r\nheaders={'Content-Encoding': 'amz-1.0', 'Connection': 'keep-alive', 'Accept': 'application/json, text/javascript, */*', 'User-Agent': 'A thing', 'Host': 'hostname', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache', 'Content-Type': 'application/json'}   # plus some service headers used by our service\r\ntimeout=False\r\nproxies=Noneﬁ\r\n\r\n> package-cache/packages/Requests/lib/python2.7/site-packages/requests/api.py:50: in request\r\n>     response = session.request(method=method, url=url, **kwargs)\r\n> package-cache/packages/Requests/lib/python2.7/site-packages/requests/sessions.py:465: in request\r\n>     resp = self.send(prep, **send_kwargs)\r\n> package-cache/packages/Requests/lib/python2.7/site-packages/requests/sessions.py:573: in send\r\n>     r = adapter.send(request, **kwargs)\r\n> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\n> \r\n> self = <requests.adapters.HTTPAdapter object at 0x7ff845dccd50>, request = <PreparedRequest [POST]>, stream = False, timeout = <requests.packages.urllib3.util.timeout.Timeout object at 0x7ff845dd0cd0>, verify = False, cert = None\r\n> proxies = {}\r\n> \r\n>     def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None):\r\n>         \"\"\"Sends PreparedRequest object. Returns Response object.\r\n> \r\n>             :param request: The :class:`PreparedRequest <PreparedRequest>` being sent.\r\n>             :param stream: (optional) Whether to stream the request content.\r\n>             :param timeout: (optional) How long to wait for the server to send\r\n>                 data before giving up, as a float, or a (`connect timeout, read\r\n>                 timeout <user/advanced.html#timeouts>`_) tuple.\r\n>             :type timeout: float or tuple\r\n>             :param verify: (optional) Whether to verify SSL certificates.\r\n>             :param cert: (optional) Any user-provided SSL certificate to be trusted.\r\n>             :param proxies: (optional) The proxies dictionary to apply to the request.\r\n>             \"\"\"\r\n> \r\n>         conn = self.get_connection(request.url, proxies)\r\n> \r\n>         self.cert_verify(conn, request.url, verify, cert)\r\n>         url = self.request_url(request, proxies)\r\n>         self.add_headers(request)\r\n> \r\n>         chunked = not (request.body is None or 'Content-Length' in request.headers)\r\n> \r\n>         if isinstance(timeout, tuple):\r\n>             try:\r\n>                 connect, read = timeout\r\n>                 timeout = TimeoutSauce(connect=connect, read=read)\r\n>             except ValueError as e:\r\n>                 # this may raise a string formatting error.\r\n>                 err = (\"Invalid timeout {0}. Pass a (connect, read) \"\r\n>                        \"timeout tuple, or a single float to set \"\r\n>                        \"both timeouts to the same value\".format(timeout))\r\n>                 raise ValueError(err)\r\n>         else:\r\n>             timeout = TimeoutSauce(connect=timeout, read=timeout)\r\n> \r\n>         try:\r\n>             if not chunked:\r\n>                 resp = conn.urlopen(\r\n>                     method=request.method,\r\n>                     url=url,\r\n>                     body=request.body,\r\n>                     headers=request.headers,\r\n>                     redirect=False,\r\n>                     assert_same_host=False,\r\n>                     preload_content=False,\r\n>                     decode_content=False,\r\n>                     retries=self.max_retries,\r\n>                     timeout=timeout\r\n>                 )\r\n>             # Send the request.\r\n>             else:\r\n>                 if hasattr(conn, 'proxy_pool'):\r\n>                     conn = conn.proxy_pool\r\n> \r\n>                 low_conn = conn._get_conn(timeout=timeout)\r\n> \r\n>                 try:\r\n>                     low_conn.putrequest(request.method,\r\n>                                         url,\r\n>                                         skip_accept_encoding=True)\r\n> \r\n>                     for header, value in request.headers.items():\r\n>                         low_conn.putheader(header, value)\r\n> \r\n>                     low_conn.endheaders()\r\n> \r\n>                     for i in request.body:\r\n>                         low_conn.send(hex(len(i))[2:].encode('utf-8'))\r\n>                         low_conn.send(b'\\r\\n')\r\n>                         low_conn.send(i)\r\n>                         low_conn.send(b'\\r\\n')\r\n>                     low_conn.send(b'0\\r\\n\\r\\n')\r\n> \r\n>                     r = low_conn.getresponse()\r\n>                     resp = HTTPResponse.from_httplib(\r\n>                         r,\r\n>                         pool=conn,\r\n>                         connection=low_conn,\r\n>                         preload_content=False,\r\n>                         decode_content=False\r\n>                     )\r\n>                 except:\r\n>                     # If we hit any problems here, clean up the connection.\r\n>                     # Then, reraise so that we can handle the actual exception.\r\n>                     low_conn.close()\r\n>                     raise\r\n>                 else:\r\n>                     # All is well, return the connection to the pool.\r\n>                     conn._put_conn(low_conn)\r\n> \r\n>         except (ProtocolError, socket.error) as err:\r\n> >           raise ConnectionError(err, request=request)\r\n> E           ConnectionError: ('Connection aborted.', error(115, 'Operation now in progress'))\r\n> \r\n> cert       = None\r\n> chunked    = False\r\n> conn       = <requests.packages.urllib3.connectionpool.HTTPConnectionPool object at 0x7ff844c68c10>\r\n> err        = ProtocolError('Connection aborted.', error(115, 'Operation now in progress'))\r\n> proxies    = {}\r\n> request    = <PreparedRequest [POST]>\r\n> self       = <requests.adapters.HTTPAdapter object at 0x7ff845dccd50>\r\n> stream     = False\r\n> timeout    = <requests.packages.urllib3.util.timeout.Timeout object at 0x7ff845dd0cd0>\r\n> url        = '/'\r\n> verify     = False\r\n> \r\n> package-cache/packages/Requests/lib/python2.7/site-packages/requests/adapters.py:415: ConnectionError\r\n> "},"comment":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/comments/126495154","html_url":"https://github.com/kennethreitz/requests/issues/2699#issuecomment-126495154","issue_url":"https://api.github.com/repos/kennethreitz/requests/issues/2699","id":126495154,"user":{"login":"offbyone","id":181693,"avatar_url":"https://avatars.githubusercontent.com/u/181693?v=3","gravatar_id":"","url":"https://api.github.com/users/offbyone","html_url":"https://github.com/offbyone","followers_url":"https://api.github.com/users/offbyone/followers","following_url":"https://api.github.com/users/offbyone/following{/other_user}","gists_url":"https://api.github.com/users/offbyone/gists{/gist_id}","starred_url":"https://api.github.com/users/offbyone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/offbyone/subscriptions","organizations_url":"https://api.github.com/users/offbyone/orgs","repos_url":"https://api.github.com/users/offbyone/repos","events_url":"https://api.github.com/users/offbyone/events{/privacy}","received_events_url":"https://api.github.com/users/offbyone/received_events","type":"User","site_admin":false},"created_at":"2015-07-30T21:25:23Z","updated_at":"2015-07-30T21:25:23Z","body":"`False`"}}