Skip to content

aioresponses is incompatible with aiohttp 3.14.0 - switch to aiointercept #12815

Description

@adubovik

Describe the bug

The folowing fix #12452
introduced a required field called stream_writer in the __init__ method of the public class aiohttp.client_reqrep.ClientResponse:

https://github.com/aio-libs/aiohttp/blob/master/aiohttp/client_reqrep.py#L219-L234

However, this breaking change has led to a bump of the minor package version: 3.13.5 => 3.14.0

This results in a lot of CI breaks accross many repos where the aiohttp bump happend automatically by dependabot to close security issue.

Is it possible to make a patch release 3.14.1 where stream_writer is an optional argument to preserve backward compatbility?

To Reproduce

Install aiohttp==3.14.0 and aioresponses==0.7.8, write a simple mock test, observe the failure:

    
        # We need to initialize headers manually
        _headers = CIMultiDict({hdrs.CONTENT_TYPE: content_type})
        if headers:
            _headers.update(headers)
        raw_headers = self._build_raw_headers(_headers)
>       resp = response_class(method, url, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       TypeError: ClientResponse.__init__() missing 1 required keyword-only argument: 'stream_writer'

.nox/test/lib/python3.11/site-packages/aioresponses/core.py:172: TypeError

pnuckowski/aioresponses#289

Expected behavior

Bump from aiohttp==3.13.5 to aiohttp==3.14.0 must not break dependant project/packages.

Logs/tracebacks

# We need to initialize headers manually
        _headers = CIMultiDict({hdrs.CONTENT_TYPE: content_type})
        if headers:
            _headers.update(headers)
        raw_headers = self._build_raw_headers(_headers)
>       resp = response_class(method, url, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       TypeError: ClientResponse.__init__() missing 1 required keyword-only argument: 'stream_writer'

.nox/test/lib/python3.11/site-packages/aioresponses/core.py:172: TypeError

Python Version

$ python --version
Python 3.11.13

aiohttp Version

$ python -m pip show aiohttp
Name: aiohttp
Version: 3.14.0
Summary: Async http client/server framework (asyncio)
Home-page: https://github.com/aio-libs/aiohttp
Author: 
Author-email: 
License: Apache-2.0 AND MIT
Location: /Users/anton_dubovik/Code/GitHub/ai-dial-adapter-dial/.venv/lib/python3.11/site-packages
Requires: aiohappyeyeballs, aiosignal, attrs, frozenlist, multidict, propcache, typing_extensions, yarl
Required-by: aioresponses

multidict Version

$ python -m pip show multidict
Name: multidict
Version: 6.0.4
Summary: multidict implementation
Home-page: https://github.com/aio-libs/multidict
Author: Andrew Svetlov
Author-email: andrew.svetlov@gmail.com
License: Apache 2
Location: /Users/anton_dubovik/Code/GitHub/ai-dial-adapter-dial/.venv/lib/python3.11/site-packages
Requires: 
Required-by: aiohttp, yarl

propcache Version

$ python -m pip show propcache
Name: propcache
Version: 0.2.0
Summary: Accelerated property cache
Home-page: https://github.com/aio-libs/propcache
Author: Andrew Svetlov
Author-email: andrew.svetlov@gmail.com
License: Apache-2.0
Location: /Users/anton_dubovik/Code/GitHub/ai-dial-adapter-dial/.venv/lib/python3.11/site-packages
Requires: 
Required-by: aiohttp, yarl

yarl Version

$ python -m pip show yarl
Name: yarl
Version: 1.17.2
Summary: Yet another URL library
Home-page: https://github.com/aio-libs/yarl
Author: Andrew Svetlov
Author-email: andrew.svetlov@gmail.com
License: Apache-2.0
Location: /Users/anton_dubovik/Code/GitHub/ai-dial-adapter-dial/.venv/lib/python3.11/site-packages
Requires: idna, multidict, propcache
Required-by: aiohttp

OS

macOS

Related component

Client

Additional context

No response

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct
Pinned by bdraco

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem rightquestionStackOverflow

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions