]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[2.7] closes bpo-8450: a better error message when http status line isn't received...
authorShoham Peller <shoham.peller@stratoscale.com>
Fri, 14 Sep 2018 23:28:08 +0000 (02:28 +0300)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 14 Sep 2018 23:28:08 +0000 (16:28 -0700)
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

index f3bb22c2b6ffd71d3598eaaf79167062c092998b..60a8fb4e355f89792baca769d538d4e849cb434b 100644 (file)
@@ -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: