Jump to solution
Verify

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%.

Jump to Verify Open PR/Commit
@@ -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
repro.py
""" 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()))
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
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
Production impact:
  • 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

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“Please see https://github.com/pnuckowski/aioresponses/pull/262”
@bdraco · 2024-11-13 · source
“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…”
@bdraco · 2024-11-14 · source
“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">”
@bdraco · 2024-11-13 · source
“fyi this is breaking for https://github.com/pnuckowski/aioresponses”
@d1manson · 2024-11-13 · source

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
signature.txt
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.txt
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

repro.py
""" 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`.

When NOT to use: This fix should not be used if the application relies on the new behavior of requiring real_url.

Fix reference: https://github.com/aio-libs/aiohttp/pull/9873

Last verified: 2026-02-09. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

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

verify
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.