[New-bugs-announce] [issue24292] wsgiref.simple_server.WSGIRequestHandler doesn't log request timeouts

Jonathan Kamens report at bugs.python.org
Tue May 26 22:28:40 CEST 2015


New submission from Jonathan Kamens:

http.BaseHTTPRequestHandler logs request timeouts. In handle_one_request():

        except socket.timeout as e:
            #a read or a write timed out.  Discard this connection
            self.log_error("Request timed out: %r", e)
            self.close_connection = 1
            return

Unfortunately, wsgiref.simple_server.WSGIRequestHandler, which overrides BaseHTTPRequestHandler's handle() method, does _not_ catch and log request timeouts. Fixing this is a simple matter of wrapping the entire body of its handle() function in a try with this except clause:

except socket.timeout as e:
    self.log_error("Request timed out: %r", e)
    raise

----------
components: Library (Lib)
messages: 244134
nosy: Jonathan Kamens
priority: normal
severity: normal
status: open
title: wsgiref.simple_server.WSGIRequestHandler doesn't log request timeouts
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24292>
_______________________________________


More information about the New-bugs-announce mailing list