Skip to content

Bump urllib3 from 2.6.3 to 2.7.0#12490

Open
dependabot[bot] wants to merge 1 commit intomasterfrom
dependabot/pip/urllib3-2.7.0
Open

Bump urllib3 from 2.6.3 to 2.7.0#12490
dependabot[bot] wants to merge 1 commit intomasterfrom
dependabot/pip/urllib3-2.7.0

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot Bot commented on behalf of github May 8, 2026

Bumps urllib3 from 2.6.3 to 2.7.0.

Release notes

Sourced from urllib3's releases.

2.7.0

🚀 urllib3 is fundraising for HTTP/2 support

urllib3 is raising ~$40,000 USD to release HTTP/2 support and ensure long-term sustainable maintenance of the project after a sharp decline in financial support. If your company or organization uses Python and would benefit from HTTP/2 support in Requests, pip, cloud SDKs, and thousands of other projects please consider contributing financially to ensure HTTP/2 support is developed sustainably and maintained for the long-haul.

Thank you for your support.

Security

Addressed high-severity security issues. Impact was limited to specific use cases detailed in the accompanying advisories; overall user exposure was estimated to be marginal.

  • Decompression-bomb safeguards of the streaming API were bypassed:

    1. When HTTPResponse.drain_conn() was called after the response had been read and decompressed partially. (Reported by @​Cycloctane)
    2. During the second HTTPResponse.read(amt=N) or HTTPResponse.stream(amt=N) call when the response was decompressed using the official Brotli library. (Reported by @​kimkou2024)

    See GHSA-mf9v-mfxr-j63j for details.

  • HTTP pools created using ProxyManager.connection_from_url did not strip sensitive headers specified in Retry.remove_headers_on_redirect when redirecting to a different host. (GHSA-qccp-gfcp-xxvc reported by @​christos-spearbit)

Deprecations and Removals

  • Used FutureWarning instead of DeprecationWarning for better visibility of existing deprecation notices. Rescheduled the removal of deprecated features to version 3.0. (urllib3/urllib3#3764)
  • Removed support for end-of-life Python 3.9. (urllib3/urllib3#3720)
  • Removed support for end-of-life PyPy3.10. (urllib3/urllib3#4979)
  • Bumped the minimum supported pyOpenSSL version to 19.0.0. (urllib3/urllib3#3777)

Bugfixes

  • Fixed a bug where HTTPResponse.read(amt=None) was ignoring decompressed data buffered from previous partial reads. (urllib3/urllib3#3636)
  • Fixed a bug where HTTPResponse.read() could cache only part of the response after a partial read when cache_content=True. (urllib3/urllib3#4967)
  • Fixed HTTPResponse.stream() and HTTPResponse.read_chunked() to handle amt=0. (urllib3/urllib3#3793)
  • Updated _TYPE_BODY type alias to include missing Iterable[str], matching the documented and runtime behavior of chunked request bodies. (urllib3/urllib3#3798)
  • Fixed LocationParseError when paths resembling schemeless URIs were passed to HTTPConnectionPool.urlopen(). (urllib3/urllib3#3352)
  • Fixed BaseHTTPResponse.readinto() type annotation to accept memoryview in addition to bytearray, matching the io.RawIOBase.readinto contract and enabling use with io.BufferedReader without type errors. (urllib3/urllib3#3764)
Changelog

Sourced from urllib3's changelog.

2.7.0 (2026-05-07)

Security

Addressed high-severity security issues. Impact was limited to specific use cases detailed in the accompanying advisories; overall user exposure was estimated to be marginal.

  • Decompression-bomb safeguards of the streaming API were bypassed:

    1. When HTTPResponse.drain_conn() was called after the response had been read and decompressed partially.
    2. During the second HTTPResponse.read(amt=N) or HTTPResponse.stream(amt=N) call when the response was decompressed using the official Brotli <https://pypi.org/project/brotli/>__ library.

    See GHSA-mf9v-mfxr-j63j <https://github.com/urllib3/urllib3/security/advisories/GHSA-mf9v-mfxr-j63j>__ for details.

  • HTTP pools created using ProxyManager.connection_from_url did not strip sensitive headers specified in Retry.remove_headers_on_redirect when redirecting to a different host. (GHSA-qccp-gfcp-xxvc <https://github.com/urllib3/urllib3/security/advisories/GHSA-qccp-gfcp-xxvc>__)

Deprecations and Removals

  • Used FutureWarning instead of DeprecationWarning for better visibility of existing deprecation notices. Rescheduled the removal of deprecated features to version 3.0. ([#3764](https://github.com/urllib3/urllib3/issues/3764) <https://github.com/urllib3/urllib3/issues/3764>__)
  • Removed support for end-of-life Python 3.9. ([#3720](https://github.com/urllib3/urllib3/issues/3720) <https://github.com/urllib3/urllib3/issues/3720>__)
  • Removed support for end-of-life PyPy3.10. ([#4979](https://github.com/urllib3/urllib3/issues/4979) <https://github.com/urllib3/urllib3/issues/4979>__)
  • Bumped the minimum supported pyOpenSSL version to 19.0.0. ([#3777](https://github.com/urllib3/urllib3/issues/3777) <https://github.com/urllib3/urllib3/issues/3777>__)

Bugfixes

  • Fixed a bug where HTTPResponse.read(amt=None) was ignoring decompressed data buffered from previous partial reads. ([#3636](https://github.com/urllib3/urllib3/issues/3636) <https://github.com/urllib3/urllib3/issues/3636>__)
  • Fixed a bug where HTTPResponse.read() could cache only part of the response after a partial read when cache_content=True.

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.6.3 to 2.7.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](urllib3/urllib3@2.6.3...2.7.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-version: 2.7.0
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added the dependencies Pull requests that update a dependency file label May 8, 2026
@dependabot dependabot Bot requested review from asvetlov and webknjaz as code owners May 8, 2026 10:46
@github-actions github-actions Bot enabled auto-merge (squash) May 8, 2026 10:48
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
4490 1 4489 73
View the top 1 failed test(s) by shortest run time
tests.test_client_middleware::test_middleware_uses_session_avoids_recursion_with_disabled_middleware[pyloop]
Stack Traces | 2.46s run time
self = <aiohttp.connector.TCPConnector object at 0x0000017B3F348CA0>
addr_infos = []
req = <aiohttp.client_reqrep.ClientRequest object at 0x0000017B3F34B250>
timeout = ClientTimeout(total=300, connect=None, sock_read=None, sock_connect=30, ceil_threshold=5)
client_error = <class 'aiohttp.client_exceptions.ClientConnectorError'>
args = (functools.partial(<class 'aiohttp.client_proto.ResponseHandler'>, loop=<ProactorEventLoop running=False closed=False debug=False>),)
kwargs = {'server_hostname': None, 'ssl': None}

    #x1B[0m#x1B[94masync#x1B[39;49;00m #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m_wrap_create_connection#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mself#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        *args: Any,#x1B[90m#x1B[39;49;00m
        addr_infos: #x1B[96mlist#x1B[39;49;00m[AddrInfoType],#x1B[90m#x1B[39;49;00m
        req: ClientRequestBase,#x1B[90m#x1B[39;49;00m
        timeout: #x1B[33m"#x1B[39;49;00m#x1B[33mClientTimeout#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        client_error: #x1B[96mtype#x1B[39;49;00m[#x1B[96mException#x1B[39;49;00m] = ClientConnectorError,#x1B[90m#x1B[39;49;00m
        **kwargs: Any,#x1B[90m#x1B[39;49;00m
    ) -> #x1B[96mtuple#x1B[39;49;00m[asyncio.Transport, ResponseHandler]:#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94masync#x1B[39;49;00m #x1B[94mwith#x1B[39;49;00m ceil_timeout(#x1B[90m#x1B[39;49;00m
                timeout.sock_connect, ceil_threshold=timeout.ceil_threshold#x1B[90m#x1B[39;49;00m
            ):#x1B[90m#x1B[39;49;00m
>               sock = #x1B[94mawait#x1B[39;49;00m aiohappyeyeballs.start_connection(#x1B[90m#x1B[39;49;00m
                    addr_infos=addr_infos,#x1B[90m#x1B[39;49;00m
                    local_addr_infos=#x1B[96mself#x1B[39;49;00m._local_addr_infos,#x1B[90m#x1B[39;49;00m
                    happy_eyeballs_delay=#x1B[96mself#x1B[39;49;00m._happy_eyeballs_delay,#x1B[90m#x1B[39;49;00m
                    interleave=#x1B[96mself#x1B[39;49;00m._interleave,#x1B[90m#x1B[39;49;00m
                    loop=#x1B[96mself#x1B[39;49;00m._loop,#x1B[90m#x1B[39;49;00m
                    socket_factory=#x1B[96mself#x1B[39;49;00m._socket_factory,#x1B[90m#x1B[39;49;00m
                )#x1B[90m#x1B[39;49;00m

addr_infos = []
args       = (functools.partial(<class 'aiohttp.client_proto.ResponseHandler'>, loop=<ProactorEventLoop running=False closed=False debug=False>),)
client_error = <class 'aiohttp.client_exceptions.ClientConnectorError'>
kwargs     = {'server_hostname': None, 'ssl': None}
req        = <aiohttp.client_reqrep.ClientRequest object at 0x0000017B3F34B250>
self       = <aiohttp.connector.TCPConnector object at 0x0000017B3F348CA0>
timeout    = ClientTimeout(total=300, connect=None, sock_read=None, sock_connect=30, ceil_threshold=5)

#x1B[1m#x1B[31maiohttp\connector.py#x1B[0m:1244: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\aiohappyeyeballs\impl.py#x1B[0m:127: in start_connection
    #x1B[0m#x1B[94mraise#x1B[39;49;00m first_exception#x1B[90m#x1B[39;49;00m
        _          = [ConnectionRefusedError(22, 'The remote computer refused the network connection', None, 1225, None), ConnectionRefusedError(22, 'The remote computer refused the network connection', None, 1225, None)]
        addr_infos = [(<AddressFamily.AF_INET6: 23>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('::1', 5358, 0, 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('127.0.0.1', 5358))]
        all_exceptions = None
        current_loop = <ProactorEventLoop running=False closed=False debug=False>
        exceptions = None
        first_exception = ConnectionRefusedError(22, 'The remote computer refused the network connection', None, 1225, None)
        happy_eyeballs_delay = 0.25
        interleave = 1
        local_addr_infos = None
        loop       = <ProactorEventLoop running=False closed=False debug=False>
        model      = '[WinError 1225] The remote computer refused the network connection'
        open_sockets = None
        single_addr_info = False
        sock       = None
        socket_factory = None
#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\aiohappyeyeballs\_staggered.py#x1B[0m:132: in run_one_coro
    #x1B[0mresult = #x1B[94mawait#x1B[39;49;00m coro_fn()#x1B[90m#x1B[39;49;00m
        coro_fn    = functools.partial(<function _connect_sock at 0x0000017B3D25E680>, <ProactorEventLoop running=False closed=False debug=...5, None)]], (<AddressFamily.AF_INET6: 23>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('::1', 5358, 0, 0)), None, set(), None)
        exceptions = [ConnectionRefusedError(22, 'The remote computer refused the network connection', None, 1225, None), ConnectionRefusedError(22, 'The remote computer refused the network connection', None, 1225, None)]
        start_next = <Future finished result=None>
        this_index = 0
#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\aiohappyeyeballs\impl.py#x1B[0m:208: in _connect_sock
    #x1B[0m#x1B[94mawait#x1B[39;49;00m loop.sock_connect(sock, address)#x1B[90m#x1B[39;49;00m
        _          = ''
        addr_info  = (<AddressFamily.AF_INET6: 23>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('::1', 5358, 0, 0))
        address    = ('::1', 5358, 0, 0)
        exceptions = None
        family     = <AddressFamily.AF_INET6: 23>
        local_addr_infos = None
        loop       = <ProactorEventLoop running=False closed=False debug=False>
        my_exceptions = None
        open_sockets = set()
        proto      = 6
        sock       = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6>
        socket_factory = None
        type_      = <SocketKind.SOCK_STREAM: 1>
#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\asyncio\proactor_events.py#x1B[0m:709: in sock_connect
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[94mawait#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._proactor.connect(sock, address)#x1B[90m#x1B[39;49;00m
        address    = ('::1', 5358, 0, 0)
        self       = <ProactorEventLoop running=False closed=False debug=False>
        sock       = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6>
#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\asyncio\windows_events.py#x1B[0m:826: in _poll
    #x1B[0mvalue = callback(transferred, key, ov)#x1B[90m#x1B[39;49;00m
        address    = 1628849938800
        callback   = <function IocpProactor.connect.<locals>.finish_connect at 0x0000017B3F8F0AF0>
        err        = 1225
        f          = None
        key        = 0
        ms         = 0
        obj        = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6>
        ov         = <_overlapped.Overlapped object at 0x0000017B3F05A160>
        self       = <IocpProactor overlapped#=3 result#=0>
        status     = None
        timeout    = 30.297000000000025
        transferred = 0
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

trans = 0, key = 0, ov = <_overlapped.Overlapped object at 0x0000017B3F05A160>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mfinish_connect#x1B[39;49;00m(trans, key, ov):#x1B[90m#x1B[39;49;00m
>       ov.getresult()#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       ConnectionRefusedError: [WinError 1225] The remote computer refused the network connection#x1B[0m

conn       = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6>
key        = 0
ov         = <_overlapped.Overlapped object at 0x0000017B3F05A160>
trans      = 0

#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\asyncio\windows_events.py#x1B[0m:613: ConnectionRefusedError

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

aiohttp_server = <function aiohttp_server.<locals>.go at 0x0000017B3F0591B0>

    #x1B[0m#x1B[94masync#x1B[39;49;00m #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_middleware_uses_session_avoids_recursion_with_disabled_middleware#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        aiohttp_server: AiohttpServer,#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"""Test that middleware can avoid infinite recursion by disabling middleware."""#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        log_collector: #x1B[96mlist#x1B[39;49;00m[#x1B[96mdict#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, #x1B[96mstr#x1B[39;49;00m]] = []#x1B[90m#x1B[39;49;00m
        request_count = #x1B[94m0#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94masync#x1B[39;49;00m #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mlog_api_handler#x1B[39;49;00m(request: web.Request) -> web.Response:#x1B[90m#x1B[39;49;00m
    #x1B[90m        #x1B[39;49;00m#x1B[33m"""Handle log API requests."""#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mnonlocal#x1B[39;49;00m request_count#x1B[90m#x1B[39;49;00m
            request_count += #x1B[94m1#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            data: #x1B[96mdict#x1B[39;49;00m[#x1B[96mstr#x1B[39;49;00m, #x1B[96mstr#x1B[39;49;00m] = #x1B[94mawait#x1B[39;49;00m request.json()#x1B[90m#x1B[39;49;00m
            log_collector.append(data)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m web.Response(text=#x1B[33m"#x1B[39;49;00m#x1B[33mOK#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94masync#x1B[39;49;00m #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mmain_handler#x1B[39;49;00m(request: web.Request) -> web.Response:#x1B[90m#x1B[39;49;00m
    #x1B[90m        #x1B[39;49;00m#x1B[33m"""Handle main server requests."""#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m web.Response(text=#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mHello from #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mrequest.path#x1B[33m}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Create log API server#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        log_app = web.Application()#x1B[90m#x1B[39;49;00m
        log_app.router.add_post(#x1B[33m"#x1B[39;49;00m#x1B[33m/log#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, log_api_handler)#x1B[90m#x1B[39;49;00m
        log_server = #x1B[94mawait#x1B[39;49;00m aiohttp_server(log_app)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Create main server#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        main_app = web.Application()#x1B[90m#x1B[39;49;00m
        main_app.router.add_get(#x1B[33m"#x1B[39;49;00m#x1B[33m/#x1B[39;49;00m#x1B[33m{#x1B[39;49;00m#x1B[33mpath:.*}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, main_handler)#x1B[90m#x1B[39;49;00m
        main_server = #x1B[94mawait#x1B[39;49;00m aiohttp_server(main_app)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94masync#x1B[39;49;00m #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mlog_middleware#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
            request: ClientRequest, handler: ClientHandlerType#x1B[90m#x1B[39;49;00m
        ) -> ClientResponse:#x1B[90m#x1B[39;49;00m
    #x1B[90m        #x1B[39;49;00m#x1B[33m"""Log all requests using session with disabled middleware."""#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[90m# Use the session from the request to make the logging call#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[90m# Disable middleware to avoid infinite recursion#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94masync#x1B[39;49;00m #x1B[94mwith#x1B[39;49;00m request.session.post(#x1B[90m#x1B[39;49;00m
                #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mhttp://localhost:#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mlog_server.port#x1B[33m}#x1B[39;49;00m#x1B[33m/log#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                json={#x1B[33m"#x1B[39;49;00m#x1B[33mmethod#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[96mstr#x1B[39;49;00m(request.method), #x1B[33m"#x1B[39;49;00m#x1B[33murl#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[96mstr#x1B[39;49;00m(request.url)},#x1B[90m#x1B[39;49;00m
                middlewares=(),  #x1B[90m# This prevents infinite recursion#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            ) #x1B[94mas#x1B[39;49;00m resp:#x1B[90m#x1B[39;49;00m
                #x1B[94massert#x1B[39;49;00m resp.status == #x1B[94m200#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[94mawait#x1B[39;49;00m handler(request)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Create session with the middleware#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94masync#x1B[39;49;00m #x1B[94mwith#x1B[39;49;00m ClientSession(middlewares=(log_middleware,)) #x1B[94mas#x1B[39;49;00m session:#x1B[90m#x1B[39;49;00m
            #x1B[90m# Make request to main server - should be logged#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94masync#x1B[39;49;00m #x1B[94mwith#x1B[39;49;00m session.get(main_server.make_url(#x1B[33m"#x1B[39;49;00m#x1B[33m/test#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)) #x1B[94mas#x1B[39;49;00m resp:#x1B[90m#x1B[39;49;00m

aiohttp_server = <function aiohttp_server.<locals>.go at 0x0000017B3F0591B0>
log_api_handler = <function test_middleware_uses_session_avoids_recursion_with_disabled_middleware.<locals>.log_api_handler at 0x0000017B3FF42C20>
log_app    = <Application 0x17b3f8bfed0>
log_collector = []
log_middleware = <function test_middleware_uses_session_avoids_recursion_with_disabled_middleware.<locals>.log_middleware at 0x0000017B3F05AE60>
log_server = <aiohttp.test_utils.TestServer object at 0x0000017B3F34B6D0>
main_app   = <Application 0x17b3f8beb90>
main_handler = <function test_middleware_uses_session_avoids_recursion_with_disabled_middleware.<locals>.main_handler at 0x0000017B3F05A9E0>
main_server = <aiohttp.test_utils.TestServer object at 0x0000017B3F349120>
request_count = 0
session    = <aiohttp.client.ClientSession object at 0x0000017B40423E20>

#x1B[1m#x1B[31mtests\test_client_middleware.py#x1B[0m:1037: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#x1B[1m#x1B[31maiohttp\client.py#x1B[0m:1532: in __aenter__
    #x1B[0m#x1B[96mself#x1B[39;49;00m._resp: _RetType_co = #x1B[94mawait#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._coro#x1B[90m#x1B[39;49;00m
        self       = <aiohttp.client._BaseRequestContextManager object at 0x0000017B3F349570>
#x1B[1m#x1B[31maiohttp\client.py#x1B[0m:769: in _request
    #x1B[0mresp = #x1B[94mawait#x1B[39;49;00m handler(req)#x1B[90m#x1B[39;49;00m
        _connect_and_send_request = <function ClientSession._request.<locals>._connect_and_send_request at 0x0000017B3F05A3B0>
        all_cookies = <BaseCookie: >
        allow_redirects = True
        auth       = None
        auth_from_url = None
        auto_decompress = True
        chunked    = None
        compress   = False
        cookies    = None
        data       = None
        effective_middlewares = (<function test_middleware_uses_session_avoids_recursion_with_disabled_middleware.<locals>.log_middleware at 0x0000017B3F05AE60>,)
        expect100  = False
        handle     = None
        handler    = <function build_client_middlewares.<locals>.single_middleware_handler at 0x0000017B3F05A8C0>
        headers    = <CIMultiDict()>
        history    = []
        json       = None
        max_field_size = 8190
        max_headers = 128
        max_line_size = 8190
        max_redirects = 10
        method     = 'GET'
        middlewares = None
        params     = {}
        proxy      = None
        proxy_     = None
        proxy_auth = None
        proxy_headers = None
        raise_for_status = None
        read_bufsize = 262144
        read_until_eof = True
        real_timeout = ClientTimeout(total=300, connect=None, sock_read=None, sock_connect=30, ceil_threshold=5)
        redirects  = 0
        req        = <aiohttp.client_reqrep.ClientRequest object at 0x0000017B3F349900>
        retry_persistent_connection = True
        self       = <aiohttp.client.ClientSession object at 0x0000017B40423E20>
        server_hostname = None
        skip_auto_headers = None
        skip_headers = None
        ssl        = True
        str_or_url = URL('http://127.0.0.1:60949/test')
        timeout    = <_SENTINEL.sentinel: 1>
        timer      = <aiohttp.helpers.TimerContext object at 0x0000017B3F13AD90>
        tm         = <aiohttp.helpers.TimeoutHandle object at 0x0000017B3F58ED80>
        trace_request_ctx = None
        traces     = []
        url        = URL('http://127.0.0.1:60949/test')
        version    = HttpVersion(major=1, minor=1)
#x1B[1m#x1B[31maiohttp\client_middlewares.py#x1B[0m:36: in single_middleware_handler
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[94mawait#x1B[39;49;00m middleware(req, handler)#x1B[90m#x1B[39;49;00m
        handler    = <function ClientSession._request.<locals>._connect_and_send_request at 0x0000017B3F05A3B0>
        middleware = <function test_middleware_uses_session_avoids_recursion_with_disabled_middleware.<locals>.log_middleware at 0x0000017B3F05AE60>
        req        = <aiohttp.client_reqrep.ClientRequest object at 0x0000017B3F349900>
#x1B[1m#x1B[31mtests\test_client_middleware.py#x1B[0m:1025: in log_middleware
    #x1B[0m#x1B[94masync#x1B[39;49;00m #x1B[94mwith#x1B[39;49;00m request.session.post(#x1B[90m#x1B[39;49;00m
        handler    = <function ClientSession._request.<locals>._connect_and_send_request at 0x0000017B3F05A3B0>
        log_server = <aiohttp.test_utils.TestServer object at 0x0000017B3F34B6D0>
        request    = <aiohttp.client_reqrep.ClientRequest object at 0x0000017B3F349900>
#x1B[1m#x1B[31maiohttp\client.py#x1B[0m:1532: in __aenter__
    #x1B[0m#x1B[96mself#x1B[39;49;00m._resp: _RetType_co = #x1B[94mawait#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._coro#x1B[90m#x1B[39;49;00m
        self       = <aiohttp.client._BaseRequestContextManager object at 0x0000017B3F34ACB0>
#x1B[1m#x1B[31maiohttp\client.py#x1B[0m:769: in _request
    #x1B[0mresp = #x1B[94mawait#x1B[39;49;00m handler(req)#x1B[90m#x1B[39;49;00m
        _connect_and_send_request = <function ClientSession._request.<locals>._connect_and_send_request at 0x0000017B3F05A290>
        all_cookies = <BaseCookie: >
        allow_redirects = True
        auth       = None
        auth_from_url = None
        auto_decompress = True
        chunked    = None
        compress   = False
        cookies    = None
        data       = <aiohttp.payload.JsonPayload object at 0x0000017B3F34A860>
        effective_middlewares = ()
        expect100  = False
        handle     = None
        handler    = <function ClientSession._request.<locals>._connect_and_send_request at 0x0000017B3F05A290>
        headers    = <CIMultiDict()>
        history    = []
        json       = {'method': 'GET', 'url': 'http://127.0.0.1:60949/test'}
        max_field_size = 8190
        max_headers = 128
        max_line_size = 8190
        max_redirects = 10
        method     = 'POST'
        middlewares = ()
        params     = {}
        proxy      = None
        proxy_     = None
        proxy_auth = None
        proxy_headers = None
        raise_for_status = None
        read_bufsize = 262144
        read_until_eof = True
        real_timeout = ClientTimeout(total=300, connect=None, sock_read=None, sock_connect=30, ceil_threshold=5)
        redirects  = 0
        req        = <aiohttp.client_reqrep.ClientRequest object at 0x0000017B3F34B250>
        retry_persistent_connection = False
        self       = <aiohttp.client.ClientSession object at 0x0000017B40423E20>
        server_hostname = None
        skip_auto_headers = None
        skip_headers = None
        ssl        = True
        str_or_url = 'http://localhost:60948/log'
        timeout    = <_SENTINEL.sentinel: 1>
        timer      = <aiohttp.helpers.TimerContext object at 0x0000017B3F13B510>
        tm         = <aiohttp.helpers.TimeoutHandle object at 0x0000017B3FAA8680>
        trace_request_ctx = None
        traces     = []
        url        = URL('http://localhost:60948/log')
        version    = HttpVersion(major=1, minor=1)
#x1B[1m#x1B[31maiohttp\client.py#x1B[0m:723: in _connect_and_send_request
    #x1B[0mconn = #x1B[94mawait#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._connector.connect(#x1B[90m#x1B[39;49;00m
        auto_decompress = True
        max_field_size = 8190
        max_headers = 128
        max_line_size = 8190
        read_bufsize = 262144
        read_until_eof = True
        real_timeout = ClientTimeout(total=300, connect=None, sock_read=None, sock_connect=30, ceil_threshold=5)
        req        = <aiohttp.client_reqrep.ClientRequest object at 0x0000017B3F34B250>
        self       = <aiohttp.client.ClientSession object at 0x0000017B40423E20>
        timer      = <aiohttp.helpers.TimerContext object at 0x0000017B3F13B510>
        traces     = []
#x1B[1m#x1B[31maiohttp\connector.py#x1B[0m:611: in connect
    #x1B[0mproto = #x1B[94mawait#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._create_connection(req, traces, timeout)#x1B[90m#x1B[39;49;00m
        conn       = None
        key        = ConnectionKey(host='localhost', port=60948, is_ssl=False, ssl=True, proxy=None, proxy_auth=None, proxy_headers_hash=None)
        placeholder = <aiohttp.connector._TransportPlaceholder object at 0x0000017B3F34AB90>
        req        = <aiohttp.client_reqrep.ClientRequest object at 0x0000017B3F34B250>
        self       = <aiohttp.connector.TCPConnector object at 0x0000017B3F348CA0>
        timeout    = ClientTimeout(total=300, connect=None, sock_read=None, sock_connect=30, ceil_threshold=5)
        traces     = []
#x1B[1m#x1B[31maiohttp\connector.py#x1B[0m:1185: in _create_connection
    #x1B[0m_, proto = #x1B[94mawait#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._create_direct_connection(req, traces, timeout)#x1B[90m#x1B[39;49;00m
        req        = <aiohttp.client_reqrep.ClientRequest object at 0x0000017B3F34B250>
        self       = <aiohttp.connector.TCPConnector object at 0x0000017B3F348CA0>
        timeout    = ClientTimeout(total=300, connect=None, sock_read=None, sock_connect=30, ceil_threshold=5)
        traces     = []
#x1B[1m#x1B[31maiohttp\connector.py#x1B[0m:1497: in _create_direct_connection
    #x1B[0m#x1B[94mraise#x1B[39;49;00m last_exc#x1B[90m#x1B[39;49;00m
        addr_infos = []
        client_error = <class 'aiohttp.client_exceptions.ClientConnectorError'>
        fingerprint = None
        host       = 'localhost'
        hosts      = [{'family': <AddressFamily.AF_INET6: 23>, 'flags': <AddressInfo.AI_NUMERICSERV|AI_NUMERICHOST: 12>, 'host': '::1', 'ho...INET: 2>, 'flags': <AddressInfo.AI_NUMERICSERV|AI_NUMERICHOST: 12>, 'host': '127.0.0.1', 'hostname': 'localhost', ...}]
        last_exc   = ClientConnectorError(ConnectionKey(host='localhost', port=60948, is_ssl=False, ssl=True, proxy=None, proxy_auth=None, ...headers_hash=None), ConnectionRefusedError(22, 'The remote computer refused the network connection', None, 1225, None))
        port       = 60948
        req        = <aiohttp.client_reqrep.ClientRequest object at 0x0000017B3F34B250>
        self       = <aiohttp.connector.TCPConnector object at 0x0000017B3F348CA0>
        server_hostname = None
        sslcontext = None
        timeout    = ClientTimeout(total=300, connect=None, sock_read=None, sock_connect=30, ceil_threshold=5)
        traces     = []
#x1B[1m#x1B[31maiohttp\connector.py#x1B[0m:1467: in _create_direct_connection
    #x1B[0mtransp, proto = #x1B[94mawait#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._wrap_create_connection(#x1B[90m#x1B[39;49;00m
        addr_infos = []
        client_error = <class 'aiohttp.client_exceptions.ClientConnectorError'>
        fingerprint = None
        host       = 'localhost'
        hosts      = [{'family': <AddressFamily.AF_INET6: 23>, 'flags': <AddressInfo.AI_NUMERICSERV|AI_NUMERICHOST: 12>, 'host': '::1', 'ho...INET: 2>, 'flags': <AddressInfo.AI_NUMERICSERV|AI_NUMERICHOST: 12>, 'host': '127.0.0.1', 'hostname': 'localhost', ...}]
        last_exc   = ClientConnectorError(ConnectionKey(host='localhost', port=60948, is_ssl=False, ssl=True, proxy=None, proxy_auth=None, ...headers_hash=None), ConnectionRefusedError(22, 'The remote computer refused the network connection', None, 1225, None))
        port       = 60948
        req        = <aiohttp.client_reqrep.ClientRequest object at 0x0000017B3F34B250>
        self       = <aiohttp.connector.TCPConnector object at 0x0000017B3F348CA0>
        server_hostname = None
        sslcontext = None
        timeout    = ClientTimeout(total=300, connect=None, sock_read=None, sock_connect=30, ceil_threshold=5)
        traces     = []
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <aiohttp.connector.TCPConnector object at 0x0000017B3F348CA0>
addr_infos = []
req = <aiohttp.client_reqrep.ClientRequest object at 0x0000017B3F34B250>
timeout = ClientTimeout(total=300, connect=None, sock_read=None, sock_connect=30, ceil_threshold=5)
client_error = <class 'aiohttp.client_exceptions.ClientConnectorError'>
args = (functools.partial(<class 'aiohttp.client_proto.ResponseHandler'>, loop=<ProactorEventLoop running=False closed=False debug=False>),)
kwargs = {'server_hostname': None, 'ssl': None}

    #x1B[0m#x1B[94masync#x1B[39;49;00m #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m_wrap_create_connection#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mself#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        *args: Any,#x1B[90m#x1B[39;49;00m
        addr_infos: #x1B[96mlist#x1B[39;49;00m[AddrInfoType],#x1B[90m#x1B[39;49;00m
        req: ClientRequestBase,#x1B[90m#x1B[39;49;00m
        timeout: #x1B[33m"#x1B[39;49;00m#x1B[33mClientTimeout#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        client_error: #x1B[96mtype#x1B[39;49;00m[#x1B[96mException#x1B[39;49;00m] = ClientConnectorError,#x1B[90m#x1B[39;49;00m
        **kwargs: Any,#x1B[90m#x1B[39;49;00m
    ) -> #x1B[96mtuple#x1B[39;49;00m[asyncio.Transport, ResponseHandler]:#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94masync#x1B[39;49;00m #x1B[94mwith#x1B[39;49;00m ceil_timeout(#x1B[90m#x1B[39;49;00m
                timeout.sock_connect, ceil_threshold=timeout.ceil_threshold#x1B[90m#x1B[39;49;00m
            ):#x1B[90m#x1B[39;49;00m
                sock = #x1B[94mawait#x1B[39;49;00m aiohappyeyeballs.start_connection(#x1B[90m#x1B[39;49;00m
                    addr_infos=addr_infos,#x1B[90m#x1B[39;49;00m
                    local_addr_infos=#x1B[96mself#x1B[39;49;00m._local_addr_infos,#x1B[90m#x1B[39;49;00m
                    happy_eyeballs_delay=#x1B[96mself#x1B[39;49;00m._happy_eyeballs_delay,#x1B[90m#x1B[39;49;00m
                    interleave=#x1B[96mself#x1B[39;49;00m._interleave,#x1B[90m#x1B[39;49;00m
                    loop=#x1B[96mself#x1B[39;49;00m._loop,#x1B[90m#x1B[39;49;00m
                    socket_factory=#x1B[96mself#x1B[39;49;00m._socket_factory,#x1B[90m#x1B[39;49;00m
                )#x1B[90m#x1B[39;49;00m
                #x1B[90m# Add ssl_shutdown_timeout for Python 3.11+ when SSL is used#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                #x1B[94mif#x1B[39;49;00m (#x1B[90m#x1B[39;49;00m
                    kwargs.get(#x1B[33m"#x1B[39;49;00m#x1B[33mssl#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                    #x1B[95mand#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._ssl_shutdown_timeout#x1B[90m#x1B[39;49;00m
                    #x1B[95mand#x1B[39;49;00m sys.version_info >= (#x1B[94m3#x1B[39;49;00m, #x1B[94m11#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                ):#x1B[90m#x1B[39;49;00m
                    kwargs[#x1B[33m"#x1B[39;49;00m#x1B[33mssl_shutdown_timeout#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m] = #x1B[96mself#x1B[39;49;00m._ssl_shutdown_timeout#x1B[90m#x1B[39;49;00m
                #x1B[94mreturn#x1B[39;49;00m #x1B[94mawait#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._loop.create_connection(*args, **kwargs, sock=sock)#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m cert_errors #x1B[94mas#x1B[39;49;00m exc:#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m ClientConnectorCertificateError(req.connection_key, exc) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mexc#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m ssl_errors #x1B[94mas#x1B[39;49;00m exc:#x1B[90m#x1B[39;49;00m
            #x1B[94mraise#x1B[39;49;00m ClientConnectorSSLError(req.connection_key, exc) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mexc#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 exc:#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m exc.errno #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m #x1B[95mand#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(exc, asyncio.TimeoutError):#x1B[90m#x1B[39;49;00m
                #x1B[94mraise#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m client_error(req.connection_key, exc) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[04m#x1B[96mexc#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:60948 ssl:default [The remote computer refused the network connection]#x1B[0m

addr_infos = []
args       = (functools.partial(<class 'aiohttp.client_proto.ResponseHandler'>, loop=<ProactorEventLoop running=False closed=False debug=False>),)
client_error = <class 'aiohttp.client_exceptions.ClientConnectorError'>
kwargs     = {'server_hostname': None, 'ssl': None}
req        = <aiohttp.client_reqrep.ClientRequest object at 0x0000017B3F34B250>
self       = <aiohttp.connector.TCPConnector object at 0x0000017B3F348CA0>
timeout    = ClientTimeout(total=300, connect=None, sock_read=None, sock_connect=30, ceil_threshold=5)

#x1B[1m#x1B[31maiohttp\connector.py#x1B[0m:1267: ClientConnectorError

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

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 8, 2026

Merging this PR will not alter performance

✅ 67 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing dependabot/pip/urllib3-2.7.0 (2b280d5) with master (7d534ab)

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

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

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants