Skip to content

Commit ee78ba2

Browse files
Shoham Pellermiss-islington
authored andcommitted
[2.7] closes bpo-8450: a better error message when http status line isn't received (GH-2825)
When the server has closed the connection before sending a status-line, the client's error message should have a more descriptive error message https://bugs.python.org/issue8450 https://bugs.python.org/issue8450
1 parent 8575503 commit ee78ba2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/httplib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ def _read_status(self):
399399
if not line:
400400
# Presumably, the server closed the connection before
401401
# sending a valid response.
402-
raise BadStatusLine(line)
402+
raise BadStatusLine("No status line received - the server has closed the connection")
403403
try:
404404
[version, status, reason] = line.split(None, 2)
405405
except ValueError:

0 commit comments

Comments
 (0)