The Fix
Added a backward compatibility layer to `RequestInfo` to allow creating these objects without a `real_url`.
Based on closed aio-libs/aiohttp issue #9866 · PR/commit linked
Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.
@@ -0,0 +1 @@
@@ -0,0 +1 @@
+Added a backward compatibility layer to `~aiohttp.RequestInfo` to allow creating these objects without a `real_url` -- by :user:`bdraco`.
diff --git a/aiohttp/client_reqrep.py b/aiohttp/client_reqrep.py
index 8e7ebbcbebe..8f7ed23f286 100644
"""
Reproduce a regression in aiohttp 3.11.0.
"""
from multidict import CIMultiDict, CIMultiDictProxy
from aiohttp.client_reqrep import RequestInfo
from yarl import URL
RequestInfo(URL(), "GET", CIMultiDictProxy(CIMultiDict()))
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Apply the official fix\nAdded a backward compatibility layer to `RequestInfo` to allow creating these objects without a `real_url`.\nWhen NOT to use: This fix should not be used if the application relies on the new behavior of requiring real_url.\n\n
Why This Fix Works in Production
- Trigger: `RequestInfo` change to a named tuple broke BC
- Mechanism: The change in RequestInfo to a named tuple made real_url a required argument, breaking existing code
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- The change in RequestInfo to a named tuple made real_url a required argument, breaking existing code
- Production symptom (often without a traceback): `RequestInfo` change to a named tuple broke BC
Proof / Evidence
- GitHub issue: #9866
- Fix PR: https://github.com/aio-libs/aiohttp/pull/9873
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.80
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.62
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Please see https://github.com/pnuckowski/aioresponses/pull/262”
“My initial call on this was we didn't want to change it because we don't expect these objects to be created externally but since there…”
“This is expected. Its mentioned as breaking in the changelog <img width="677" alt="Screenshot 2024-11-13 at 1 46 17 PM" src="https://github.com/user-attachments/assets/f45ae766-6f85-4ca5-a110-b8e25076b59b">”
“fyi this is breaking for https://github.com/pnuckowski/aioresponses”
Failure Signature (Search String)
- `RequestInfo` change to a named tuple broke BC
- Existing usage of aiohttp 3.10 no longer works with aiohttp 3.13, causing the following error: `TypeError: RequestInfo.__new__() missing 1 required positional argument: 'real_url'`
Copy-friendly signature
Failure Signature
-----------------
`RequestInfo` change to a named tuple broke BC
Existing usage of aiohttp 3.10 no longer works with aiohttp 3.13, causing the following error: `TypeError: RequestInfo.__new__() missing 1 required positional argument: 'real_url'`
Error Message
Signature-only (no traceback captured)
Error Message
-------------
`RequestInfo` change to a named tuple broke BC
Existing usage of aiohttp 3.10 no longer works with aiohttp 3.13, causing the following error: `TypeError: RequestInfo.__new__() missing 1 required positional argument: 'real_url'`
Minimal Reproduction
"""
Reproduce a regression in aiohttp 3.11.0.
"""
from multidict import CIMultiDict, CIMultiDictProxy
from aiohttp.client_reqrep import RequestInfo
from yarl import URL
RequestInfo(URL(), "GET", CIMultiDictProxy(CIMultiDict()))
What Broke
Users encountered TypeError when creating RequestInfo without real_url, causing application failures.
Why It Broke
The change in RequestInfo to a named tuple made real_url a required argument, breaking existing code
Fix Options (Details)
Option A — Apply the official fix
Added a backward compatibility layer to `RequestInfo` to allow creating these objects without a `real_url`.
Fix reference: https://github.com/aio-libs/aiohttp/pull/9873
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be used if the application relies on the new behavior of requiring real_url.
Verify Fix
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Capture the exact failing error string in logs and tests so you can reproduce via a minimal script.
- Pin production dependencies and upgrade only with a reproducible test that hits the failing path.
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.