Skip to content

Instantly share code, notes, and snippets.

import ssl
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.poolmanager import PoolManager
class TLSv1Adapter(HTTPAdapter):
""""Transport adapter" that allows us to use TLSv1."""
def init_poolmanager(self, connections, maxsize, block=False):
@mike-plivo
mike-plivo / gevent_requests_test.py
Created December 22, 2011 23:32
kennethreitz/requests issue 3239
"""
Some requests receive a Response but keep the socket in
CLOSE_WAIT state until process is killed .
Some requests raise ConnectionError after some time and
seem to block others unprocessed spawned requests until
all ConnectionError are not raised .
(all http connection pool slots are busy ?)
"""