#NEWLINE# def _make_request( self , conn , method , url , timeout = _Default , chunked = False , **httplib_request_kw ) : #NEWLINE# #INDENT# '\n        Perform a request on a given urllib connection object taken from our\n        pool.\n\n        :param conn:\n            a connection from one of our connection pools\n\n        :param timeout:\n            Socket timeout in seconds for the request. This can be a\n            float or integer, which will set the same timeout value for\n            the socket connect and the socket read, or an instance of\n            :class:`urllib3.util.Timeout`, which gives you more fine-grained\n            control over your timeouts.\n        ' #NEWLINE# self . num_requests += 1 #NEWLINE# timeout_obj = self . _get_timeout ( timeout ) #NEWLINE# timeout_obj . start_connect ( ) #NEWLINE# conn . timeout = timeout_obj . connect_timeout #NEWLINE# try : #NEWLINE# #INDENT# self . _validate_conn ( conn ) #NEWLINE# #UNINDENT# except ( SocketTimeout , BaseSSLError ) as e : #NEWLINE# #INDENT# self . _raise_timeout ( err = e , url = url , timeout_value = conn . timeout ) #NEWLINE# raise #NEWLINE# #UNINDENT# if chunked : #NEWLINE# #INDENT# conn . request_chunked ( method , url , ** httplib_request_kw ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# conn . request ( method , url , ** httplib_request_kw ) #NEWLINE# #UNINDENT# read_timeout = timeout_obj . read_timeout #NEWLINE# if getattr ( httplib_request_kw , 'sock' , None ) : #NEWLINE# #INDENT# if ( read_timeout == 0 ) : #NEWLINE# #INDENT# raise ReadTimeoutError ( self , url , ( 'Read timed out. (read timeout=%s)' % read_timeout ) ) #NEWLINE# #UNINDENT# if ( read_timeout is Timeout . DEFAULT_TIMEOUT ) : #NEWLINE# #INDENT# conn . sock . settimeout ( socket . getdefaulttimeout ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# conn . sock . settimeout ( read_timeout ) #NEWLINE# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# httplib_response = conn . getresponse ( buffering = True ) #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# httplib_response = conn . getresponse ( ) #NEWLINE# #UNINDENT# #UNINDENT# except ( SocketTimeout , BaseSSLError , SocketError ) as e : #NEWLINE# #INDENT# self . _raise_timeout ( err = e , url = url , timeout_value = read_timeout ) #NEWLINE# raise #NEWLINE# #UNINDENT# http_version = getattr ( conn , '_http_vsn_str' , 'HTTP/?' ) #NEWLINE# log . debug ( '"%s %s %s" %s %s' , method , url , http_version , httplib_response . status , httplib_response . length ) #NEWLINE# try : #NEWLINE# #INDENT# assert_header_parsing ( httplib_response . msg ) #NEWLINE# #UNINDENT# except HeaderParsingError as hpe : #NEWLINE# #INDENT# log . warning ( 'Failed to parse headers (url=%s): %s' , self . _absolute_url ( url ) , hpe , exc_info = True ) #NEWLINE# #UNINDENT# return httplib_response