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.
@@ -10,6 +10,24 @@
.. towncrier release notes start
+3.11.1 (2024-11-14)
+===================
+
Make a call using aiohttp.request, e.g.,
Follow the reproduction steps, confirm the failure, apply the fix, and repeat the same steps to verify the behavior changes.
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.
- 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
- GitHub issue: #9878
- Fix PR: https://github.com/aio-libs/aiohttp/pull/9875
- 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.84
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…”
“@bdraco is this fixed with https://github.com/aio-libs/aiohttp/pull/9875?”
Failure Signature (Search String)
- TypeError: RequestInfo.__new__() missing 1 required positional argument: 'real_url'
Error Message
Stack trace
Error Message
-------------
TypeError: RequestInfo.__new__() missing 1 required positional argument: 'real_url'
Minimal Reproduction
- 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.
Fix reference: https://github.com/aio-libs/aiohttp/pull/9875
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 absence of a real_url for specific functionality.
Verify Fix
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.