public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Benjamin A. Beasley <code@musicinmybrain.net>
To: git-commits@fedoraproject.org
Subject: [rpms/python-aioresponses] f45: Patch for aiohttp 3.14
Date: Mon, 24 Aug 2026 06:34:17 GMT	[thread overview]
Message-ID: <178755325769.1.15635880508728783218.rpms-python-aioresponses-02adb2cf8fc5@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/python-aioresponses
Branch : f45
Commit : 02adb2cf8fc5f96e0a80877dd25adb2651b87b4a
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date   : 2026-08-21T07:01:21+01:00
Stats  : +126/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/python-aioresponses/c/02adb2cf8fc5f96e0a80877dd25adb2651b87b4a?branch=f45

Log:
Patch for aiohttp 3.14

---
diff --git a/292.patch b/292.patch
new file mode 100644
index 0000000..a9b58ad
--- /dev/null
+++ b/292.patch
@@ -0,0 +1,108 @@
+From 1a48e1f898035e3bedc981f06520842c55977706 Mon Sep 17 00:00:00 2001
+From: kleine-safie <k-guilherme@safie.jp>
+Date: Wed, 10 Jun 2026 11:05:30 +0900
+Subject: [PATCH] support for pause_reading
+
+---
+ aioresponses/compat.py     |  5 +++++
+ aioresponses/core.py       |  2 ++
+ tests/test_aioresponses.py | 11 ++++++++++-
+ tox.ini                    | 11 ++++++-----
+ 4 files changed, 23 insertions(+), 6 deletions(-)
+
+diff --git a/aioresponses/compat.py b/aioresponses/compat.py
+index 83fd47a..e95ecb2 100644
+--- a/aioresponses/compat.py
++++ b/aioresponses/compat.py
+@@ -2,6 +2,7 @@
+ import asyncio  # noqa: F401
+ from re import Pattern
+ from typing import Dict, Optional, Union  # noqa
++from unittest.mock import Mock
+ from urllib.parse import parse_qsl, urlencode
+ 
+ from aiohttp import __version__ as aiohttp_version, StreamReader
+@@ -17,6 +18,10 @@ def stream_reader_factory(  # noqa
+     loop: 'Optional[asyncio.AbstractEventLoop]' = None
+ ) -> StreamReader:
+     protocol = ResponseHandler(loop=loop)
++    # Satisfies BaseProtocol's flow control hooks that
++    # fire when a large payload exceeds the StreamReader limit.
++    protocol._parser = Mock()
++    protocol._parser.feed_data.return_value = ([], False, b'')
+     return StreamReader(protocol, limit=2 ** 16, loop=loop)
+ 
+ 
+diff --git a/aioresponses/core.py b/aioresponses/core.py
+index a904cf9..52640f3 100644
+--- a/aioresponses/core.py
++++ b/aioresponses/core.py
+@@ -182,6 +182,8 @@ def _build_response(self, url: 'Union[URL, str]',
+             headers=CIMultiDictProxy(self._prepare_request_headers(request_headers)),
+             real_url=url
+         )
++        if 'stream_writer' in inspect.signature(response_class).parameters:
++            kwargs['stream_writer'] = Mock(output_size=0)
+         kwargs['writer'] = None
+         kwargs['continue100'] = None
+         kwargs['timer'] = TimerNoop()
+diff --git a/tests/test_aioresponses.py b/tests/test_aioresponses.py
+index 68bec3f..45c0d87 100644
+--- a/tests/test_aioresponses.py
++++ b/tests/test_aioresponses.py
+@@ -4,9 +4,10 @@
+ from asyncio import CancelledError, TimeoutError
+ from random import uniform
+ from typing import Coroutine, Generator, Union
+-from unittest.mock import patch
++from unittest.mock import MagicMock, patch
+ 
+ from aiohttp import hdrs
++from aiohttp.base_protocol import BaseProtocol
+ from aiohttp import http
+ from aiohttp.client import ClientSession
+ from aiohttp.client_reqrep import ClientResponse
+@@ -312,6 +313,14 @@ async def test_streaming(self, m):
+         content = await resp.content.read()
+         self.assertEqual(content, b'Test')
+ 
++    @aioresponses()
++    async def test_streaming_large_body(self, m):
++        body = b'x' * (1024 * 1024)
++        m.get(self.url, body=body)
++        resp = await self.session.get(self.url)
++        content = await resp.content.read()
++        self.assertEqual(content, body)
++
+     @aioresponses()
+     async def test_streaming_up_to(self, m):
+         m.get(self.url, body='Test')
+diff --git a/tox.ini b/tox.ini
+index e520402..240dd71 100644
+--- a/tox.ini
++++ b/tox.ini
+@@ -1,11 +1,11 @@
+ [tox]
+ envlist =
+     flake8,
+-    py310-aiohttp{38,39,310,311,312},
+-    py311-aiohttp{39,310,311,312,313},
+-    py312-aiohttp{39,310,311,312,313},
+-    py313-aiohttp{310,311,312,313},
+-    py314-aiohttp313,
++    py310-aiohttp{38,39,310,311,312,314},
++    py311-aiohttp{39,310,311,312,313,314},
++    py312-aiohttp{39,310,311,312,313,314},
++    py313-aiohttp{310,311,312,313,314},
++    py314-aiohttp{313,314},
+     coverage
+ no_package = true
+ skip_missing_interpreters = true
+@@ -27,6 +27,7 @@ deps =
+     aiohttp311: aiohttp~=3.11.0
+     aiohttp312: aiohttp~=3.12.0
+     aiohttp313: aiohttp~=3.13.0
++    aiohttp314: aiohttp~=3.14.0
+ commands =
+     python -m pytest -q {posargs}
+ 

diff --git a/python-aioresponses.spec b/python-aioresponses.spec
index 83bb447..34feaa2 100644
--- a/python-aioresponses.spec
+++ b/python-aioresponses.spec
@@ -9,6 +9,24 @@ License:        MIT
 URL:            https://github.com/pnuckowski/aioresponses
 Source:         %{pypi_source}
 
+# fix: support aiohttp 3.14 pause_reading - #292
+# https://github.com/pnuckowski/aioresponses/pull/292
+#
+# Fixes:
+# - issue with aiohttp-3.14:
+#   https://github.com/pnuckowski/aioresponses/issues/289
+# - `aioresponses` is incompatible with aiohttp 3.14.0 - switch to
+#   `aiointercept`: https://github.com/aio-libs/aiohttp/issues/12815
+#
+# See also:
+# - fix: support aiohttp 3.14 required stream_writer argument
+#   https://github.com/pnuckowski/aioresponses/pull/288
+# - ci: test against aiohttp 3.14
+#   https://github.com/pnuckowski/aioresponses/pull/291
+# - feat: Add support for aiohttp 3.14:
+#   https://github.com/pnuckowski/aioresponses/pull/290
+Patch:          %{url}/pull/292.patch
+
 BuildArch:      noarch
 # Since python-aiohttp excludes s390x we have to exclude it, as well
 # See also:

                 reply	other threads:[~2026-08-24  6:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178755325769.1.15635880508728783218.rpms-python-aioresponses-02adb2cf8fc5@fedoraproject.org \
    --to=code@musicinmybrain.net \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox