From ee78ba2c819b0cd7671a575e584d8fe1b7adb3e4 Mon Sep 17 00:00:00 2001 From: Shoham Peller Date: Sat, 15 Sep 2018 02:28:08 +0300 Subject: [PATCH] [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 --- Lib/httplib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/httplib.py b/Lib/httplib.py index f3bb22c2b6ff..60a8fb4e355f 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -399,7 +399,7 @@ class HTTPResponse: if not line: # Presumably, the server closed the connection before # sending a valid response. - raise BadStatusLine(line) + raise BadStatusLine("No status line received - the server has closed the connection") try: [version, status, reason] = line.split(None, 2) except ValueError: -- 2.47.3