Skip to content

Fix 503 request flags in unservicable connections#831

Open
andrewkernel wants to merge 2 commits into
cherrypy:mainfrom
andrewkernel:fix-unservicable-request-flags
Open

Fix 503 request flags in unservicable connections#831
andrewkernel wants to merge 2 commits into
cherrypy:mainfrom
andrewkernel:fix-unservicable-request-flags

Conversation

@andrewkernel

Copy link
Copy Markdown

Summary

  • pass the server's proxy_mode and strict_mode settings into the HTTPRequest created for 503 responses
  • keep the unservicable-connection path consistent with normal request handling
  • add a regression test that verifies those flags are propagated

Testing

  • python -m pytest --no-cov cheroot/test/test_server.py -k unservicable_conn_uses_server_proxy_and_strict_mode

Resolves #823.

@read-the-docs-community

read-the-docs-community Bot commented Jun 27, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cheroot | 🛠️ Build #33334384 | 📁 Comparing a433c69 against latest (3937fe1)

  🔍 Preview build  

6 files changed · ± 6 modified

± Modified

@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
214 1 213 3
View the full list of 1 ❄️ flaky test(s)
cheroot/test/test_server.py::test_overload_results_in_suitable_http_error

Flake rate in main: 28.57% (Passed 5 times, Failed 2 times)

Stack Traces | 20s run time
self = <urllib3.connectionpool.HTTPConnectionPool object at 0x7f9a0802fe00>
conn = <HTTPConnection(host='127.0.0.1', port=55841) at 0x7f9a0802f8c0>
method = 'GET', url = '/', body = None
headers = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}
retries = Retry(total=0, connect=None, read=False, redirect=None, status=None)
timeout = Timeout(connect=20, read=20, total=None), chunked = False
response_conn = <HTTPConnection(host='127.0.0.1', port=55841) at 0x7f9a0802f8c0>
preload_content = False, decode_content = False, enforce_content_length = True

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m_make_request#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mself#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        conn: BaseHTTPConnection,#x1B[90m#x1B[39;49;00m
        method: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        url: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        body: _TYPE_BODY | #x1B[94mNone#x1B[39;49;00m = #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        headers: typing.Mapping[#x1B[96mstr#x1B[39;49;00m, #x1B[96mstr#x1B[39;49;00m] | #x1B[94mNone#x1B[39;49;00m = #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        retries: Retry | #x1B[94mNone#x1B[39;49;00m = #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,#x1B[90m#x1B[39;49;00m
        chunked: #x1B[96mbool#x1B[39;49;00m = #x1B[94mFalse#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        response_conn: BaseHTTPConnection | #x1B[94mNone#x1B[39;49;00m = #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        preload_content: #x1B[96mbool#x1B[39;49;00m = #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        decode_content: #x1B[96mbool#x1B[39;49;00m = #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        enforce_content_length: #x1B[96mbool#x1B[39;49;00m = #x1B[94mTrue#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
    ) -> BaseHTTPResponse:#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""#x1B[39;49;00m
    #x1B[33m    Perform a request on a given urllib connection object taken from our#x1B[39;49;00m
    #x1B[33m    pool.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    :param conn:#x1B[39;49;00m
    #x1B[33m        a connection from one of our connection pools#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    :param method:#x1B[39;49;00m
    #x1B[33m        HTTP request method (such as GET, POST, PUT, etc.)#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    :param url:#x1B[39;49;00m
    #x1B[33m        The URL to perform the request on.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    :param body:#x1B[39;49;00m
    #x1B[33m        Data to send in the request body, either :class:`str`, :class:`bytes`,#x1B[39;49;00m
    #x1B[33m        an iterable of :class:`str`/:class:`bytes`, or a file-like object.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    :param headers:#x1B[39;49;00m
    #x1B[33m        Dictionary of custom headers to send, such as User-Agent,#x1B[39;49;00m
    #x1B[33m        If-None-Match, etc. If None, pool headers are used. If provided,#x1B[39;49;00m
    #x1B[33m        these headers completely replace any pool-specific headers.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    :param retries:#x1B[39;49;00m
    #x1B[33m        Configure the number of retries to allow before raising a#x1B[39;49;00m
    #x1B[33m        :class:`~urllib3.exceptions.MaxRetryError` exception.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m        Pass ``None`` to retry until you receive a response. Pass a#x1B[39;49;00m
    #x1B[33m        :class:`~urllib3.util.retry.Retry` object for fine-grained control#x1B[39;49;00m
    #x1B[33m        over different types of retries.#x1B[39;49;00m
    #x1B[33m        Pass an integer number to retry connection errors that many times,#x1B[39;49;00m
    #x1B[33m        but no other types of errors. Pass zero to never retry.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m        If ``False``, then retries are disabled and any exception is raised#x1B[39;49;00m
    #x1B[33m        immediately. Also, instead of raising a MaxRetryError on redirects,#x1B[39;49;00m
    #x1B[33m        the redirect response will be returned.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    :param timeout:#x1B[39;49;00m
    #x1B[33m        If specified, overrides the default timeout for this one#x1B[39;49;00m
    #x1B[33m        request. It may be a float (in seconds) or an instance of#x1B[39;49;00m
    #x1B[33m        :class:`urllib3.util.Timeout`.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    :param chunked:#x1B[39;49;00m
    #x1B[33m        If True, urllib3 will send the body using chunked transfer#x1B[39;49;00m
    #x1B[33m        encoding. Otherwise, urllib3 will send the body using the standard#x1B[39;49;00m
    #x1B[33m        content-length form. Defaults to False.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    :param response_conn:#x1B[39;49;00m
    #x1B[33m        Set this to ``None`` if you will handle releasing the connection or#x1B[39;49;00m
    #x1B[33m        set the connection to have the response release it.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    :param preload_content:#x1B[39;49;00m
    #x1B[33m      If True, the response's body will be preloaded during construction.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    :param decode_content:#x1B[39;49;00m
    #x1B[33m        If True, will attempt to decode the body based on the#x1B[39;49;00m
    #x1B[33m        'content-encoding' header.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    :param enforce_content_length:#x1B[39;49;00m
    #x1B[33m        Enforce content length checking. Body returned by server must match#x1B[39;49;00m
    #x1B[33m        value of Content-Length header, if present. Otherwise, raise error.#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[96mself#x1B[39;49;00m.num_requests += #x1B[94m1#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        timeout_obj = #x1B[96mself#x1B[39;49;00m._get_timeout(timeout)#x1B[90m#x1B[39;49;00m
        timeout_obj.start_connect()#x1B[90m#x1B[39;49;00m
        conn.timeout = Timeout.resolve_default_timeout(timeout_obj.connect_timeout)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[90m# Trigger any extra validation we need to do.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                #x1B[96mself#x1B[39;49;00m._validate_conn(conn)#x1B[90m#x1B[39;49;00m
            #x1B[94mexcept#x1B[39;49;00m (SocketTimeout, BaseSSLError) #x1B[94mas#x1B[39;49;00m e:#x1B[90m#x1B[39;49;00m
                #x1B[96mself#x1B[39;49;00m._raise_timeout(err=e, url=url, timeout_value=conn.timeout)#x1B[90m#x1B[39;49;00m
                #x1B[94mraise#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# _validate_conn() starts the connection to an HTTPS proxy#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# so we need to wrap errors with 'ProxyError' here too.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m (#x1B[90m#x1B[39;49;00m
            #x1B[96mOSError#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            NewConnectionError,#x1B[90m#x1B[39;49;00m
            #x1B[96mTimeoutError#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            BaseSSLError,#x1B[90m#x1B[39;49;00m
            CertificateError,#x1B[90m#x1B[39;49;00m
            SSLError,#x1B[90m#x1B[39;49;00m
        ) #x1B[94mas#x1B[39;49;00m e:#x1B[90m#x1B[39;49;00m
            new_e: #x1B[96mException#x1B[39;49;00m = e#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(e, (BaseSSLError, CertificateError)):#x1B[90m#x1B[39;49;00m
                new_e = SSLError(e)#x1B[90m#x1B[39;49;00m
            #x1B[90m# If the connection didn't successfully connect to it's proxy#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[90m# then there#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
                new_e, (#x1B[96mOSError#x1B[39;49;00m, NewConnectionError, #x1B[96mTimeoutError#x1B[39;49;00m, SSLError)#x1B[90m#x1B[39;49;00m
            ) #x1B[95mand#x1B[39;49;00m (conn #x1B[95mand#x1B[39;49;00m conn.proxy #x1B[95mand#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m conn.has_connected_to_proxy):#x1B[90m#x1B[39;49;00m
                new_e = _wrap_proxy_error(new_e, conn.proxy.scheme)#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m new_e#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# conn.request() calls http.client.*.request, not the method in#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# urllib3.request. It also calls makefile (recv) on the socket.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            conn.request(#x1B[90m#x1B[39;49;00m
                method,#x1B[90m#x1B[39;49;00m
                url,#x1B[90m#x1B[39;49;00m
                body=body,#x1B[90m#x1B[39;49;00m
                headers=headers,#x1B[90m#x1B[39;49;00m
                chunked=chunked,#x1B[90m#x1B[39;49;00m
                preload_content=preload_content,#x1B[90m#x1B[39;49;00m
                decode_content=decode_content,#x1B[90m#x1B[39;49;00m
                enforce_content_length=enforce_content_length,#x1B[90m#x1B[39;49;00m
            )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# We are swallowing BrokenPipeError (errno.EPIPE) since the server is#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# legitimately able to close the connection after sending a valid response.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# With this behaviour, the received response is still readable.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mBrokenPipeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mpass#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mOSError#x1B[39;49;00m #x1B[94mas#x1B[39;49;00m e:#x1B[90m#x1B[39;49;00m
            #x1B[90m# MacOS/Linux#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[90m# EPROTOTYPE and ECONNRESET are needed on macOS#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[90m# https://erickt.github..../11/19/adventures-in-debugging-a-potential-osx-kernel-bug/#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[90m# Condition changed later to emit ECONNRESET instead of only EPROTOTYPE.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m e.errno != errno.EPROTOTYPE #x1B[95mand#x1B[39;49;00m e.errno != errno.ECONNRESET:#x1B[90m#x1B[39;49;00m
                #x1B[94mraise#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Reset the timeout for the recv() on the socket#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        read_timeout = timeout_obj.read_timeout#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m conn.is_closed:#x1B[90m#x1B[39;49;00m
            #x1B[90m# In Python 3 socket.py will catch EAGAIN and return None when you#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[90m# try and read into the file pointer created by http.client, which#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[90m# instead raises a BadStatusLine exception. Instead of catching#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[90m# the exception and assuming all BadStatusLine exceptions are read#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[90m# timeouts, check for a zero timeout before making the request.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m read_timeout == #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                #x1B[94mraise#x1B[39;49;00m ReadTimeoutError(#x1B[90m#x1B[39;49;00m
                    #x1B[96mself#x1B[39;49;00m, url, #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mRead timed out. (read timeout=#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mread_timeout#x1B[33m}#x1B[39;49;00m#x1B[33m)#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                )#x1B[90m#x1B[39;49;00m
            conn.timeout = read_timeout#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Receive the response from the server#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           response = conn.getresponse()#x1B[90m#x1B[39;49;00m
                       ^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

body       = None
chunked    = False
conn       = <HTTPConnection(host='127.0.0.1', port=55841) at 0x7f9a0802f8c0>
decode_content = False
enforce_content_length = True
headers    = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}
method     = 'GET'
preload_content = False
read_timeout = 20
response_conn = <HTTPConnection(host='127.0.0.1', port=55841) at 0x7f9a0802f8c0>
retries    = Retry(total=0, connect=None, read=False, redirect=None, status=None)
self       = <urllib3.connectionpool.HTTPConnectionPool object at 0x7f9a0802fe00>
timeout    = Timeout(connect=20, read=20, total=None)
timeout_obj = Timeout(connect=20, read=20, total=None)
url        = '/'

#x1B[1m#x1B[31m..../py/lib/python3.13.............../site-packages/urllib3/connectionpool.py#x1B[0m:534: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m..../py/lib/python3.13.../site-packages/urllib3/connection.py#x1B[0m:571: in getresponse
    #x1B[0mhttplib_response = #x1B[96msuper#x1B[39;49;00m().getresponse()#x1B[90m#x1B[39;49;00m
                       ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
        HTTPResponse = <class 'urllib3.response.HTTPResponse'>
        __class__  = <class 'urllib3.connection.HTTPConnection'>
        _shutdown  = <built-in method shutdown of socket object at 0x7f9a08d800c0>
        resp_options = _ResponseOptions(request_method='GET', request_url='/', preload_content=False, decode_content=False, enforce_content_length=True)
        self       = <HTTPConnection(host='127.0.0.1', port=55841) at 0x7f9a0802f8c0>
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.14............/x64/lib/python3.13/http/client.py#x1B[0m:1459: in getresponse
    #x1B[0mresponse.begin()#x1B[90m#x1B[39;49;00m
        response   = <http.client.HTTPResponse object at 0x7f9a00fb43a0>
        self       = <HTTPConnection(host='127.0.0.1', port=55841) at 0x7f9a0802f8c0>
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.14............/x64/lib/python3.13/http/client.py#x1B[0m:336: in begin
    #x1B[0mversion, status, reason = #x1B[96mself#x1B[39;49;00m._read_status()#x1B[90m#x1B[39;49;00m
                              ^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
        self       = <http.client.HTTPResponse object at 0x7f9a00fb43a0>
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.14............/x64/lib/python3.13/http/client.py#x1B[0m:297: in _read_status
    #x1B[0mline = #x1B[96mstr#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m.fp.readline(_MAXLINE + #x1B[94m1#x1B[39;49;00m), #x1B[33m"#x1B[39;49;00m#x1B[33miso-8859-1#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
        self       = <http.client.HTTPResponse object at 0x7f9a00fb43a0>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <socket.SocketIO object at 0x7f9a00fb4370>
b = <memory at 0x7f9a00f90400>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mreadinto#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, b):#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Read up to len(b) bytes into the writable buffer *b* and return#x1B[39;49;00m
    #x1B[33m    the number of bytes read.  If the socket is non-blocking and no bytes#x1B[39;49;00m
    #x1B[33m    are available, None is returned.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    If *b* is non-empty, a 0 return value indicates that the connection#x1B[39;49;00m
    #x1B[33m    was shutdown at the other end.#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[96mself#x1B[39;49;00m._checkClosed()#x1B[90m#x1B[39;49;00m
        #x1B[96mself#x1B[39;49;00m._checkReadable()#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._timeout_occurred:#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mOSError#x1B[39;49;00m(#x1B[33m"#x1B[39;49;00m#x1B[33mcannot read from timed out object#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           #x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._sock.recv_into(b)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           TimeoutError: timed out#x1B[0m

b          = <memory at 0x7f9a00f90400>
self       = <socket.SocketIO object at 0x7f9a00fb4370>

#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.14............/x64/lib/python3.13/socket.py#x1B[0m:723: TimeoutError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

self = <requests.adapters.HTTPAdapter object at 0x7f9a081ebd10>
request = <PreparedRequest [GET]>, stream = False
timeout = Timeout(connect=20, read=20, total=None), verify = True, cert = None
proxies = OrderedDict()

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92msend#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mself#x1B[39;49;00m, request, stream=#x1B[94mFalse#x1B[39;49;00m, timeout=#x1B[94mNone#x1B[39;49;00m, verify=#x1B[94mTrue#x1B[39;49;00m, cert=#x1B[94mNone#x1B[39;49;00m, proxies=#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Sends PreparedRequest object. Returns Response object.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    :param request: The :class:`PreparedRequest <PreparedRequest>` being sent.#x1B[39;49;00m
    #x1B[33m    :param stream: (optional) Whether to stream the request content.#x1B[39;49;00m
    #x1B[33m    :param timeout: (optional) How long to wait for the server to send#x1B[39;49;00m
    #x1B[33m        data before giving up, as a float, or a :ref:`(connect timeout,#x1B[39;49;00m
    #x1B[33m        read timeout) <timeouts>` tuple.#x1B[39;49;00m
    #x1B[33m    :type timeout: float or tuple or urllib3 Timeout object#x1B[39;49;00m
    #x1B[33m    :param verify: (optional) Either a boolean, in which case it controls whether#x1B[39;49;00m
    #x1B[33m        we verify the server's TLS certificate, or a string, in which case it#x1B[39;49;00m
    #x1B[33m        must be a path to a CA bundle to use#x1B[39;49;00m
    #x1B[33m    :param cert: (optional) Any user-provided SSL certificate to be trusted.#x1B[39;49;00m
    #x1B[33m    :param proxies: (optional) The proxies dictionary to apply to the request.#x1B[39;49;00m
    #x1B[33m    :rtype: requests.Response#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            conn = #x1B[96mself#x1B[39;49;00m.get_connection_with_tls_context(#x1B[90m#x1B[39;49;00m
                request, verify, proxies=proxies, cert=cert#x1B[90m#x1B[39;49;00m
            )#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m LocationValueError #x1B[94mas#x1B[39;49;00m e:#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m InvalidURL(e, request=request)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[96mself#x1B[39;49;00m.cert_verify(conn, request.url, verify, cert)#x1B[90m#x1B[39;49;00m
        url = #x1B[96mself#x1B[39;49;00m.request_url(request, proxies)#x1B[90m#x1B[39;49;00m
        #x1B[96mself#x1B[39;49;00m.add_headers(#x1B[90m#x1B[39;49;00m
            request,#x1B[90m#x1B[39;49;00m
            stream=stream,#x1B[90m#x1B[39;49;00m
            timeout=timeout,#x1B[90m#x1B[39;49;00m
            verify=verify,#x1B[90m#x1B[39;49;00m
            cert=cert,#x1B[90m#x1B[39;49;00m
            proxies=proxies,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        chunked = #x1B[95mnot#x1B[39;49;00m (request.body #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m #x1B[95mor#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mContent-Length#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95min#x1B[39;49;00m request.headers)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(timeout, #x1B[96mtuple#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
            #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                connect, read = timeout#x1B[90m#x1B[39;49;00m
                timeout = TimeoutSauce(connect=connect, read=read)#x1B[90m#x1B[39;49;00m
            #x1B[94mexcept#x1B[39;49;00m #x1B[96mValueError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                #x1B[94mraise#x1B[39;49;00m #x1B[96mValueError#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
                    #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mInvalid timeout #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mtimeout#x1B[33m}#x1B[39;49;00m#x1B[33m. Pass a (connect, read) timeout tuple, #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                    #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mor a single float to set both timeouts to the same value.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                )#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(timeout, TimeoutSauce):#x1B[90m#x1B[39;49;00m
            #x1B[94mpass#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            timeout = TimeoutSauce(connect=timeout, read=timeout)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           resp = conn.urlopen(#x1B[90m#x1B[39;49;00m
                method=request.method,#x1B[90m#x1B[39;49;00m
                url=url,#x1B[90m#x1B[39;49;00m
                body=request.body,#x1B[90m#x1B[39;49;00m
                headers=request.headers,#x1B[90m#x1B[39;49;00m
                redirect=#x1B[94mFalse#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                assert_same_host=#x1B[94mFalse#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                preload_content=#x1B[94mFalse#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                decode_content=#x1B[94mFalse#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                retries=#x1B[96mself#x1B[39;49;00m.max_retries,#x1B[90m#x1B[39;49;00m
                timeout=timeout,#x1B[90m#x1B[39;49;00m
                chunked=chunked,#x1B[90m#x1B[39;49;00m
            )#x1B[90m#x1B[39;49;00m

cert       = None
chunked    = False
conn       = <urllib3.connectionpool.HTTPConnectionPool object at 0x7f9a0802fe00>
proxies    = OrderedDict()
request    = <PreparedRequest [GET]>
self       = <requests.adapters.HTTPAdapter object at 0x7f9a081ebd10>
stream     = False
timeout    = Timeout(connect=20, read=20, total=None)
url        = '/'
verify     = True

#x1B[1m#x1B[31m..../py/lib/python3.13....../site-packages/requests/adapters.py#x1B[0m:644: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m..../py/lib/python3.13.............../site-packages/urllib3/connectionpool.py#x1B[0m:841: in urlopen
    #x1B[0mretries = retries.increment(#x1B[90m#x1B[39;49;00m
        assert_same_host = False
        body       = None
        body_pos   = None
        chunked    = False
        clean_exit = False
        conn       = None
        decode_content = False
        destination_scheme = None
        err        = None
        headers    = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}
        http_tunnel_required = False
        method     = 'GET'
        new_e      = ReadTimeoutError("HTTPConnectionPool(host='127.0.0.1', port=55841): Read timed out. (read timeout=20)")
        parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/', query=None, fragment=None)
        pool_timeout = None
        preload_content = False
        redirect   = False
        release_conn = False
        release_this_conn = True
        response_conn = <HTTPConnection(host='127.0.0.1', port=55841) at 0x7f9a0802f8c0>
        response_kw = {}
        retries    = Retry(total=0, connect=None, read=False, redirect=None, status=None)
        self       = <urllib3.connectionpool.HTTPConnectionPool object at 0x7f9a0802fe00>
        timeout    = Timeout(connect=20, read=20, total=None)
        timeout_obj = Timeout(connect=20, read=20, total=None)
        url        = '/'
#x1B[1m#x1B[31m..../py/lib/python3.13.../urllib3/util/retry.py#x1B[0m:474: in increment
    #x1B[0m#x1B[94mraise#x1B[39;49;00m reraise(#x1B[96mtype#x1B[39;49;00m(error), error, _stacktrace)#x1B[90m#x1B[39;49;00m
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
        _pool      = <urllib3.connectionpool.HTTPConnectionPool object at 0x7f9a0802fe00>
        _stacktrace = <traceback object at 0x7f9a096ccec0>
        cause      = 'unknown'
        connect    = None
        error      = ReadTimeoutError("HTTPConnectionPool(host='127.0.0.1', port=55841): Read timed out. (read timeout=20)")
        method     = 'GET'
        other      = None
        read       = False
        redirect   = None
        redirect_location = None
        response   = None
        self       = Retry(total=0, connect=None, read=False, redirect=None, status=None)
        status     = None
        status_count = None
        total      = -1
        url        = '/'
#x1B[1m#x1B[31m..../py/lib/python3.13.../urllib3/util/util.py#x1B[0m:39: in reraise
    #x1B[0m#x1B[94mraise#x1B[39;49;00m value#x1B[90m#x1B[39;49;00m
        tb         = None
        tp         = <class 'urllib3.exceptions.ReadTimeoutError'>
        value      = None
#x1B[1m#x1B[31m..../py/lib/python3.13.............../site-packages/urllib3/connectionpool.py#x1B[0m:787: in urlopen
    #x1B[0mresponse = #x1B[96mself#x1B[39;49;00m._make_request(#x1B[90m#x1B[39;49;00m
        assert_same_host = False
        body       = None
        body_pos   = None
        chunked    = False
        clean_exit = False
        conn       = None
        decode_content = False
        destination_scheme = None
        err        = None
        headers    = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}
        http_tunnel_required = False
        method     = 'GET'
        new_e      = ReadTimeoutError("HTTPConnectionPool(host='127.0.0.1', port=55841): Read timed out. (read timeout=20)")
        parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/', query=None, fragment=None)
        pool_timeout = None
        preload_content = False
        redirect   = False
        release_conn = False
        release_this_conn = True
        response_conn = <HTTPConnection(host='127.0.0.1', port=55841) at 0x7f9a0802f8c0>
        response_kw = {}
        retries    = Retry(total=0, connect=None, read=False, redirect=None, status=None)
        self       = <urllib3.connectionpool.HTTPConnectionPool object at 0x7f9a0802fe00>
        timeout    = Timeout(connect=20, read=20, total=None)
        timeout_obj = Timeout(connect=20, read=20, total=None)
        url        = '/'
#x1B[1m#x1B[31m..../py/lib/python3.13.............../site-packages/urllib3/connectionpool.py#x1B[0m:536: in _make_request
    #x1B[0m#x1B[96mself#x1B[39;49;00m._raise_timeout(err=e, url=url, timeout_value=read_timeout)#x1B[90m#x1B[39;49;00m
        body       = None
        chunked    = False
        conn       = <HTTPConnection(host='127.0.0.1', port=55841) at 0x7f9a0802f8c0>
        decode_content = False
        enforce_content_length = True
        headers    = {'User-Agent': 'python-requests/2.32.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}
        method     = 'GET'
        preload_content = False
        read_timeout = 20
        response_conn = <HTTPConnection(host='127.0.0.1', port=55841) at 0x7f9a0802f8c0>
        retries    = Retry(total=0, connect=None, read=False, redirect=None, status=None)
        self       = <urllib3.connectionpool.HTTPConnectionPool object at 0x7f9a0802fe00>
        timeout    = Timeout(connect=20, read=20, total=None)
        timeout_obj = Timeout(connect=20, read=20, total=None)
        url        = '/'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <urllib3.connectionpool.HTTPConnectionPool object at 0x7f9a0802fe00>
err = TimeoutError('timed out'), url = '/', timeout_value = 20

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m_raise_timeout#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mself#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        err: BaseSSLError | #x1B[96mOSError#x1B[39;49;00m | SocketTimeout,#x1B[90m#x1B[39;49;00m
        url: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        timeout_value: _TYPE_TIMEOUT | #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Is the error actually a timeout? Will raise a ReadTimeout or pass"""#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(err, SocketTimeout):#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m ReadTimeoutError(#x1B[90m#x1B[39;49;00m
                #x1B[96mself#x1B[39;49;00m, url, #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mRead timed out. (read timeout=#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mtimeout_value#x1B[33m}#x1B[39;49;00m#x1B[33m)#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            ) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96merr#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='127.0.0.1', port=55841): Read timed out. (read timeout=20)#x1B[0m

err        = TimeoutError('timed out')
self       = <urllib3.connectionpool.HTTPConnectionPool object at 0x7f9a0802fe00>
timeout_value = 20
url        = '/'

#x1B[1m#x1B[31m..../py/lib/python3.13.............../site-packages/urllib3/connectionpool.py#x1B[0m:367: ReadTimeoutError

#x1B[33mDuring handling of the above exception, another exception occurred:#x1B[0m

request = <FixtureRequest for <Function test_overload_results_in_suitable_http_error>>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_overload_results_in_suitable_http_error#x1B[39;49;00m(request):#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""A server that can't keep up with requests returns a 503 HTTP error."""#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        localhost = #x1B[33m'#x1B[39;49;00m#x1B[33m127.0.0.1#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        httpserver = HTTPServer(#x1B[90m#x1B[39;49;00m
            bind_addr=(localhost, EPHEMERAL_PORT),#x1B[90m#x1B[39;49;00m
            gateway=Gateway,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
        #x1B[90m# Can only handle on request in parallel:#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        httpserver.requests = ThreadPool(#x1B[90m#x1B[39;49;00m
            #x1B[96mmin#x1B[39;49;00m=#x1B[94m1#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            #x1B[96mmax#x1B[39;49;00m=#x1B[94m1#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            accepted_queue_size=#x1B[94m1#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            accepted_queue_timeout=#x1B[94m0#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            server=httpserver,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        httpserver.prepare()#x1B[90m#x1B[39;49;00m
        serve_thread = threading.Thread(target=httpserver.serve)#x1B[90m#x1B[39;49;00m
        serve_thread.start()#x1B[90m#x1B[39;49;00m
        request.addfinalizer(httpserver.stop)#x1B[90m#x1B[39;49;00m
        #x1B[90m# Stop the thread pool to ensure the queue fills up:#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        httpserver.requests.stop()#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        _host, port = httpserver.bind_addr#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Use up the very limited thread pool queue we've set up, so future#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# requests fail:#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        httpserver.requests._queue.put(#x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       response = requests.get(#x1B[33mf#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mhttp://#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mlocalhost#x1B[33m}#x1B[39;49;00m#x1B[33m:#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mport#x1B[33m}#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m, timeout=#x1B[94m20#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

_host      = '127.0.0.1'
httpserver = <cheroot.server.HTTPServer object at 0x7f9a08069bf0>
localhost  = '127.0.0.1'
port       = 55841
request    = <FixtureRequest for <Function test_overload_results_in_suitable_http_error>>
serve_thread = <Thread(Thread-238 (serve), started 140299452016320)>

#x1B[1m#x1B[31mcheroot/test/test_server.py#x1B[0m:676: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m..../py/lib/python3.13....../site-packages/requests/api.py#x1B[0m:73: in get
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m request(#x1B[33m"#x1B[39;49;00m#x1B[33mget#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, url, params=params, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
        kwargs     = {'timeout': 20}
        params     = None
        url        = 'http://127.0.0.1:55841'
#x1B[1m#x1B[31m..../py/lib/python3.13....../site-packages/requests/api.py#x1B[0m:59: in request
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m session.request(method=method, url=url, **kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
        kwargs     = {'params': None, 'timeout': 20}
        method     = 'get'
        session    = <requests.sessions.Session object at 0x7f9a0802f380>
        url        = 'http://127.0.0.1:55841'
#x1B[1m#x1B[31m..../py/lib/python3.13....../site-packages/requests/sessions.py#x1B[0m:589: in request
    #x1B[0mresp = #x1B[96mself#x1B[39;49;00m.send(prep, **send_kwargs)#x1B[90m#x1B[39;49;00m
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
        allow_redirects = True
        auth       = None
        cert       = None
        cookies    = None
        data       = None
        files      = None
        headers    = None
        hooks      = None
        json       = None
        method     = 'get'
        params     = None
        prep       = <PreparedRequest [GET]>
        proxies    = {}
        req        = <Request [GET]>
        self       = <requests.sessions.Session object at 0x7f9a0802f380>
        send_kwargs = {'allow_redirects': True, 'cert': None, 'proxies': OrderedDict(), 'stream': False, ...}
        settings   = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'verify': True}
        stream     = None
        timeout    = 20
        url        = 'http://127.0.0.1:55841'
        verify     = None
#x1B[1m#x1B[31m..../py/lib/python3.13....../site-packages/requests/sessions.py#x1B[0m:703: in send
    #x1B[0mr = adapter.send(request, **kwargs)#x1B[90m#x1B[39;49;00m
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m
        adapter    = <requests.adapters.HTTPAdapter object at 0x7f9a081ebd10>
        allow_redirects = True
        hooks      = {'response': []}
        kwargs     = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': 20, ...}
        request    = <PreparedRequest [GET]>
        self       = <requests.sessions.Session object at 0x7f9a0802f380>
        start      = 1782543782.6963372
        stream     = False
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <requests.adapters.HTTPAdapter object at 0x7f9a081ebd10>
request = <PreparedRequest [GET]>, stream = False
timeout = Timeout(connect=20, read=20, total=None), verify = True, cert = None
proxies = OrderedDict()

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92msend#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mself#x1B[39;49;00m, request, stream=#x1B[94mFalse#x1B[39;49;00m, timeout=#x1B[94mNone#x1B[39;49;00m, verify=#x1B[94mTrue#x1B[39;49;00m, cert=#x1B[94mNone#x1B[39;49;00m, proxies=#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    ):#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Sends PreparedRequest object. Returns Response object.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    :param request: The :class:`PreparedRequest <PreparedRequest>` being sent.#x1B[39;49;00m
    #x1B[33m    :param stream: (optional) Whether to stream the request content.#x1B[39;49;00m
    #x1B[33m    :param timeout: (optional) How long to wait for the server to send#x1B[39;49;00m
    #x1B[33m        data before giving up, as a float, or a :ref:`(connect timeout,#x1B[39;49;00m
    #x1B[33m        read timeout) <timeouts>` tuple.#x1B[39;49;00m
    #x1B[33m    :type timeout: float or tuple or urllib3 Timeout object#x1B[39;49;00m
    #x1B[33m    :param verify: (optional) Either a boolean, in which case it controls whether#x1B[39;49;00m
    #x1B[33m        we verify the server's TLS certificate, or a string, in which case it#x1B[39;49;00m
    #x1B[33m        must be a path to a CA bundle to use#x1B[39;49;00m
    #x1B[33m    :param cert: (optional) Any user-provided SSL certificate to be trusted.#x1B[39;49;00m
    #x1B[33m    :param proxies: (optional) The proxies dictionary to apply to the request.#x1B[39;49;00m
    #x1B[33m    :rtype: requests.Response#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            conn = #x1B[96mself#x1B[39;49;00m.get_connection_with_tls_context(#x1B[90m#x1B[39;49;00m
                request, verify, proxies=proxies, cert=cert#x1B[90m#x1B[39;49;00m
            )#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m LocationValueError #x1B[94mas#x1B[39;49;00m e:#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m InvalidURL(e, request=request)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[96mself#x1B[39;49;00m.cert_verify(conn, request.url, verify, cert)#x1B[90m#x1B[39;49;00m
        url = #x1B[96mself#x1B[39;49;00m.request_url(request, proxies)#x1B[90m#x1B[39;49;00m
        #x1B[96mself#x1B[39;49;00m.add_headers(#x1B[90m#x1B[39;49;00m
            request,#x1B[90m#x1B[39;49;00m
            stream=stream,#x1B[90m#x1B[39;49;00m
            timeout=timeout,#x1B[90m#x1B[39;49;00m
            verify=verify,#x1B[90m#x1B[39;49;00m
            cert=cert,#x1B[90m#x1B[39;49;00m
            proxies=proxies,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        chunked = #x1B[95mnot#x1B[39;49;00m (request.body #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m #x1B[95mor#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mContent-Length#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95min#x1B[39;49;00m request.headers)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(timeout, #x1B[96mtuple#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
            #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                connect, read = timeout#x1B[90m#x1B[39;49;00m
                timeout = TimeoutSauce(connect=connect, read=read)#x1B[90m#x1B[39;49;00m
            #x1B[94mexcept#x1B[39;49;00m #x1B[96mValueError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                #x1B[94mraise#x1B[39;49;00m #x1B[96mValueError#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
                    #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mInvalid timeout #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mtimeout#x1B[33m}#x1B[39;49;00m#x1B[33m. Pass a (connect, read) timeout tuple, #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                    #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mor a single float to set both timeouts to the same value.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                )#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(timeout, TimeoutSauce):#x1B[90m#x1B[39;49;00m
            #x1B[94mpass#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            timeout = TimeoutSauce(connect=timeout, read=timeout)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            resp = conn.urlopen(#x1B[90m#x1B[39;49;00m
                method=request.method,#x1B[90m#x1B[39;49;00m
                url=url,#x1B[90m#x1B[39;49;00m
                body=request.body,#x1B[90m#x1B[39;49;00m
                headers=request.headers,#x1B[90m#x1B[39;49;00m
                redirect=#x1B[94mFalse#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                assert_same_host=#x1B[94mFalse#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                preload_content=#x1B[94mFalse#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                decode_content=#x1B[94mFalse#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                retries=#x1B[96mself#x1B[39;49;00m.max_retries,#x1B[90m#x1B[39;49;00m
                timeout=timeout,#x1B[90m#x1B[39;49;00m
                chunked=chunked,#x1B[90m#x1B[39;49;00m
            )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m (ProtocolError, #x1B[96mOSError#x1B[39;49;00m) #x1B[94mas#x1B[39;49;00m err:#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mConnectionError#x1B[39;49;00m(err, request=request)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m MaxRetryError #x1B[94mas#x1B[39;49;00m e:#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(e.reason, ConnectTimeoutError):#x1B[90m#x1B[39;49;00m
                #x1B[90m# TODO: Remove this in 3.0.0: see #2811#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(e.reason, NewConnectionError):#x1B[90m#x1B[39;49;00m
                    #x1B[94mraise#x1B[39;49;00m ConnectTimeout(e, request=request)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(e.reason, ResponseError):#x1B[90m#x1B[39;49;00m
                #x1B[94mraise#x1B[39;49;00m RetryError(e, request=request)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(e.reason, _ProxyError):#x1B[90m#x1B[39;49;00m
                #x1B[94mraise#x1B[39;49;00m ProxyError(e, request=request)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(e.reason, _SSLError):#x1B[90m#x1B[39;49;00m
                #x1B[90m# This branch is for urllib3 v1.22 and later.#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[94mraise#x1B[39;49;00m SSLError(e, request=request)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mConnectionError#x1B[39;49;00m(e, request=request)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m ClosedPoolError #x1B[94mas#x1B[39;49;00m e:#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m #x1B[96mConnectionError#x1B[39;49;00m(e, request=request)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m _ProxyError #x1B[94mas#x1B[39;49;00m e:#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m ProxyError(e)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m (_SSLError, _HTTPError) #x1B[94mas#x1B[39;49;00m e:#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(e, _SSLError):#x1B[90m#x1B[39;49;00m
                #x1B[90m# This branch is for urllib3 versions earlier than v1.22#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[94mraise#x1B[39;49;00m SSLError(e, request=request)#x1B[90m#x1B[39;49;00m
            #x1B[94melif#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(e, ReadTimeoutError):#x1B[90m#x1B[39;49;00m
>               #x1B[94mraise#x1B[39;49;00m ReadTimeout(e, request=request)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE               requests.exceptions.ReadTimeout: HTTPConnectionPool(host='127.0.0.1', port=55841): Read timed out. (read timeout=20)#x1B[0m

cert       = None
chunked    = False
conn       = <urllib3.connectionpool.HTTPConnectionPool object at 0x7f9a0802fe00>
proxies    = OrderedDict()
request    = <PreparedRequest [GET]>
self       = <requests.adapters.HTTPAdapter object at 0x7f9a081ebd10>
stream     = False
timeout    = Timeout(connect=20, read=20, total=None)
url        = '/'
verify     = True

#x1B[1m#x1B[31m..../py/lib/python3.13....../site-packages/requests/adapters.py#x1B[0m:690: ReadTimeout

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTTPConnection not passing proxy_mode and strict_mode to HTTPRequest __init__

1 participant