Uh oh!
There was an error while loading. Please reload this page.
Conversation
The base class implementation is empty and python will otherwise emit a "ResourceWarning unclosed <socket.socket ...>" for the unclosed sockets.
lovelydinosaur
commented
May 27, 2020
Hiya! So, httpcore is a low-level HTTP client, which means that you're required to ensure you're closing connections, eg. as documented in the quickstart... http_version, status_code, reason_phrase, headers, stream=awaithttp.request(
method=b'GET',
url=(b'https', b'example.org', 443, b'/'),
)
try:
body=b''.join(chunkasyncforchunkinstream)
finally:
awaitstream.close()It's really important to use the Higher level clients like Having said that, we should forcibly close outstanding connections, yup, although this PR isn't quite the right approach. (I'm also surprised that it passed the tests - since the sync & async cases aren't in sync here.) |
lovelydinosaur
commented
May 27, 2020
Closing in favour of #98 |
ghost
commented
May 27, 2020
I did run into this using Should this have worked without the fix? Is there another bug in httpx? |
lovelydinosaur
commented
May 27, 2020
Ah gotcha. Anyways yup, without #98 we're not properly closing connections when the pool is cleaned up. We'll release a 0.9.1 version shortly. Thanks for having filed this! |
The base class implementation is empty and python will otherwise emit
a "ResourceWarning unclosed <socket.socket ...>" for the unclosed
sockets.