AttributeError: 'NoneType' object has no attribute 'getpeername' using AsyncClient and AsyncRetrying(tenacity) #3222
Unanswered
arihantaraza
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When requesting an url with AsyncClient, I have the following error :
Fatal error for domain hpsj-mvh 'NoneType' object has no attribute 'getpeername' (AttributeError)
Here is a part of the error traceback
in httpcore/_async/connection.py", line 78, in handle_async_request
ssl_object = stream.get_extra_info("ssl_object")
in httpcore/_backends/anyio.py", line 85, in get_extra_info
return self._stream.extra(anyio.streams.tls.TLSAttribute.ssl_object, None)
in anyio/_core/_typedattr.py", line 78, in extra
return self.extra_attributesattribute
in anyio/abc/_sockets.py", line 63, in extra_attributes
peername: tuple[str, int] | None = convert(self._raw_socket.getpeername())
AttributeError: 'NoneType' object has no attribute 'getpeername'`
Simplified code snippet:
Python version: 3.10
OS: Ubuntu
The issue exist on HTTP/1.1, not tested for HTTP/2
The issue exist on AsyncClient not tested for Client
The issue exist when using asyncio not tested for trio
Thank you for any advice
Beta Was this translation helpful? Give feedback.
All reactions