aio-libs / aio-libs/aiohttp

`aioresponses` is incompatible with aiohttp 3.14.0 - switch to `aiointercept`

Đang mở
#12,815 11 bình luận 7 reaction 0 người được giao Xem trên GitHub
invalid question
Ngôn ngữ chính
Python
Star
16.5k
Fork
2.4k
Merge trung bình
17 giờ 22 phút
Pull request đã merge (30 ngày)
212

Mô tả

### Describe the bug

The folowing fix https://github.com/aio-libs/aiohttp/pull/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:

```text

# 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
```

https://github.com/pnuckowski/aioresponses/issues/289

### Expected behavior

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

### Logs/tracebacks

```python-traceback
# 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

```console
$ python --version
Python 3.11.13
```

### aiohttp Version

```console
$ 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

```console
$ 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

```console
$ 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

```console
$ 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

- [x] I agree to follow the aio-libs Code of Conduct

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.