msg103545 - (view) |
Author: (mschu) |
Date: 2010-04-18 22:45 |
Independent from HTTP strict, an invalid BadStatusLine() exception is raised when a keep-alive connection exceeds its timeout: client->server s->c s->c: FIN/ACK c->s: ACK c->s: /FIN s->c: RST (without data) which raises the exception. An easy workaround is to either poll information often enough for the server to not close the connection or close and reopen the connection. However, the exception is misleading. |
|
|
msg183575 - (view) |
Author: karl (karlcow) * |
Date: 2013-03-06 02:44 |
Hmm no code. I wonder if it's about this part. http://hg.python.org/cpython/file/3.3/Lib/http/client.py#l321 |
|
|
msg231410 - (view) |
Author: Martin Panter (martin.panter) *  |
Date: 2014-11-20 03:30 |
See also Issue 3566, which also brings up the false BadStatusLine exception, and suggests some kind of retry logic. Whatever exception it is, it could be documented better. In Issue 66621, the poster thought it should be an IncompleteRead exception. |
|
|
msg231411 - (view) |
Author: Martin Panter (martin.panter) *  |
Date: 2014-11-20 03:33 |
Sorry the IncompleteRead reference was meant to be Issue 666219 |
|
|
msg234105 - (view) |
Author: Demian Brecht (demian.brecht) *  |
Date: 2015-01-16 01:03 |
This should likely be closed as a duplicate of #3566, which has additional detail. |
|
|
msg246926 - (view) |
Author: Martin Panter (martin.panter) *  |
Date: 2015-07-19 00:11 |
Issue 3566 has added a new exception subclass, RemoteDisconnected, in 3.5. People are still complaining about the old BadStatusLine exception in Python 2 though. See Issue 23054. Python 2 could still get better documentation of the BadStatusLine exception. Currently it gives the impression that it only happens when the “strict” parameter is True, and a status line was received that was not understood. The exception message could also be improved. Due to Issue 7427, there is a special case to make the message literally two quote signs (''), representing an empty string. Perhaps messages like “End of stream signalled”, “No status line”, or “Empty status line” would be clearer. |
|
|
msg289498 - (view) |
Author: Shoham Peller (Shoham Peller) |
Date: 2017-03-12 12:11 |
How about back-porting the v3.5 fix, and the new "RemoteDisconnected" exception? Is that reasonable? |
|
|
msg289513 - (view) |
Author: Martin Panter (martin.panter) *  |
Date: 2017-03-12 21:56 |
I don’t think so. It is best to avoid a new exception type (even a subclass) in a bug fix. That would break code which checks “type(exc) == BadStatusLine” or similar. Specific exception messages are supposed to be implementation details, and the current message is already quirky due to the change from Issue 7427 (released in 2.7a4). That is why I thought it might be reasonable to just change the exception message in a bug fix. |
|
|
msg325414 - (view) |
Author: miss-islington (miss-islington) |
Date: 2018-09-14 23:28 |
New changeset ee78ba2c819b0cd7671a575e584d8fe1b7adb3e4 by Miss Islington (bot) (Shoham Peller) in branch '2.7': [2.7] closes bpo-8450: a better error message when http status line isn't received (GH-2825) https://github.com/python/cpython/commit/ee78ba2c819b0cd7671a575e584d8fe1b7adb3e4 |
|
|