Jump to solution
Verify

The Fix

Adds a backward compatibility layer to aiohttp.RequestInfo to allow creating these objects without a real_url, resolving the TypeError encountered in version 3.11.0.

Based on closed aio-libs/aiohttp issue #9878 · PR/commit linked

Production note: This usually shows up under retries/timeouts. Treat it as a side-effect risk until you can verify behavior with a canary + real traffic.

Jump to Verify Open PR/Commit
@@ -10,6 +10,24 @@ .. towncrier release notes start +3.11.1 (2024-11-14) +=================== +
repro
Make a call using aiohttp.request, e.g.,
verify
Follow the reproduction steps, confirm the failure, apply the fix, and repeat the same steps to verify the behavior changes.
fix.md
Option A — Apply the official fix\nAdds a backward compatibility layer to aiohttp.RequestInfo to allow creating these objects without a real_url, resolving the TypeError encountered in version 3.11.0.\nWhen NOT to use: This fix should not be used if the application relies on the absence of a real_url for specific functionality.\n\n

Why This Fix Works in Production

  • Trigger: TypeError: RequestInfo.__new__() missing 1 required positional argument: 'real_url'
  • Mechanism: Adds a backward compatibility layer to aiohttp.RequestInfo to allow creating these objects without a real_url, resolving the TypeError encountered in version 3.11.0.
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

  • Shows up under Python 3.12.7 in real deployments (not just unit tests).
  • Surfaces as: TypeError: RequestInfo.__new__() missing 1 required positional argument: 'real_url'

Proof / Evidence

Discussion

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

“Well, aiohttp.request() should work. I'm hoping they just failed to mention they were using aioresponses (which would be obvious if the traceback, as requested in…”
@Dreamsorcerer · 2024-11-14 · source
“@bdraco is this fixed with https://github.com/aio-libs/aiohttp/pull/9875?”
@webknjaz · 2024-11-14 · source

Failure Signature (Search String)

  • TypeError: RequestInfo.__new__() missing 1 required positional argument: 'real_url'

Error Message

Stack trace
error.txt
Error Message ------------- TypeError: RequestInfo.__new__() missing 1 required positional argument: 'real_url'

Minimal Reproduction

  1. Make a call using aiohttp.request, e.g.,

Environment

  • Python: 3.12.7

Fix Options (Details)

Option A — Apply the official fix

Adds a backward compatibility layer to aiohttp.RequestInfo to allow creating these objects without a real_url, resolving the TypeError encountered in version 3.11.0.

When NOT to use: This fix should not be used if the application relies on the absence of a real_url for specific functionality.

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

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 absence of a real_url for specific functionality.

Verify Fix

verify
Follow the reproduction steps, confirm the failure, apply the fix, and repeat the same steps to verify the behavior changes.

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.