bpo-27682: Handle client connection terminations in wsgiref (GH-9713)

This commit is contained in:
Petter Strandmark 2019-05-01 19:32:15 +02:00 committed by Berker Peksag
parent 18029d80bd
commit 3d37ea25dc
3 changed files with 24 additions and 0 deletions

View file

@ -136,6 +136,10 @@ class BaseHandler:
self.setup_environ()
self.result = application(self.environ, self.start_response)
self.finish_response()
except (ConnectionAbortedError, BrokenPipeError, ConnectionResetError):
# We expect the client to close the connection abruptly from time
# to time.
return
except:
try:
self.handle_error()