-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error message not always propagated on 3.9.4 #8395
Comments
Thanks for reporting the regression! It sounds like it may be a result of this improvement attempt: #8089. Would you be able to submit a PR with just a regression test? It'll help whoever gets to fixing it in the future.. |
Of course #8396 |
I see something similar aiohttp.client_exceptions.ClientResponseError: 0, message='', url=URL('https://finance.yahoo.com/quote/AAPL/') but this does not happen when I run a debugger. File "/home/ph/Git/yahoofinance/.venv/lib/python3.12/site-packages/aiohttp/client.py", line 1197, in __aenter__
self._resp = await self._coro
^^^^^^^^^^^^^^^^
File "/home/ph/Git/yahoofinance/.venv/lib/python3.12/site-packages/aiohttp/client.py", line 608, in _request
await resp.start(conn)
File "/home/ph/Git/yahoofinance/.venv/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1009, in start
for hdr in self.headers.getall(hdrs.SET_COOKIE, ()):
^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'getall' I furthermore noticed in this scenario is self.headers None but self._headers not --> underlying exception: 'Got more than 8190 bytes (10339) when reading Header value is too long.' originated here: aiohttp/aiohttp/_http_parser.pyx Line 733 in 8504b71
|
@webknjaz It's the line you left a comment on: https://github.com/aio-libs/aiohttp/pull/8089/files#r1491913635 |
@Dreamsorcerer oh, so it might be swallowed somewhere up the stack? |
Describe the bug
In 3.9.3 this would work and the
ClientResponseError
thrown would look like400, message='Got more than 8190 bytes (10000) when reading Header value is too long.', url=URL('http://127.0.0.1:51163/')
.Starting in 3.9.4 however an empty
ClientResponseError
seems to be raised0, message='', url=URL('http://127.0.0.1:51193/')
.I can see that the expected error message is thrown up the stack (specifically in
aiohttp/client_proto.py
) but the actual information about it is lost when it reachesaiohttp/client_reqrep.py
.To Reproduce
See repro case above.
Expected behavior
I expect
ClientResponseError
to have a 400 status rather than 0 and the message to be populated with the actual error.Logs/tracebacks
Python Version
3.11.8
aiohttp Version
multidict Version
yarl Version
OS
macos sonoma 14.4.1
Related component
Client
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: