Incomplete message body received when streaming response #304
Unanswered
kpfleming
asked this question in
Potential Issue
Replies: 1 comment 3 replies
-
Would you be able to reduce this down to an easily reproducible stand-alone example? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(This appears to be related to #201, where this exception was added)
I've got some code (below) running in Python 3.8.3 (as packaged in RHEL 8), using httpx 0.17.1. I'm seeing random cases where an exception is thrown claiming that the connection was closed before the complete message body was sent, but I suspect the actual situation is that the connection was closed by the server after it had sent the entire body but before the entire body had been read from the response object.
Code:
I'm seeing exceptions caught by the
except Exception
clause, and I'm 100% positive that the server did send the full body, but the socket-closure was noticed before the response had been fully ready.For now, I'm going to catch this particular exception and 'absorb' it so that I can continue reading, but I'm wondering if there's something else I should be doing.
Beta Was this translation helpful? Give feedback.
All reactions