diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-06-29 10:12:22 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-06-29 10:12:22 (GMT) |
commit | 34eeed42901666fce099947f93dfdfc05411f286 (patch) | |
tree | 26bd3fea92143532a1a7fd725d08733819a779d1 /Lib/wsgiref/simple_server.py | |
parent | 7acc3486d64c7625d9a366c5834028aa81ae162c (diff) | |
download | cpython-34eeed42901666fce099947f93dfdfc05411f286.zip cpython-34eeed42901666fce099947f93dfdfc05411f286.tar.gz cpython-34eeed42901666fce099947f93dfdfc05411f286.tar.bz2 |
Issue #26721: Change StreamRequestHandler.wfile to BufferedIOBase
Diffstat (limited to 'Lib/wsgiref/simple_server.py')
-rw-r--r-- | Lib/wsgiref/simple_server.py | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/Lib/wsgiref/simple_server.py b/Lib/wsgiref/simple_server.py index da74d7b..f71563a 100644 --- a/Lib/wsgiref/simple_server.py +++ b/Lib/wsgiref/simple_server.py @@ -11,7 +11,6 @@ module. See also the BaseHTTPServer module docs for other API information. """ from http.server import BaseHTTPRequestHandler, HTTPServer -from io import BufferedWriter import sys import urllib.parse from wsgiref.handlers import SimpleHandler @@ -127,17 +126,11 @@ class WSGIRequestHandler(BaseHTTPRequestHandler): if not self.parse_request(): # An error code has been sent, just exit return - # Avoid passing the raw file object wfile, which can do partial - # writes (Issue 24291) - stdout = BufferedWriter(self.wfile) - try: - handler = ServerHandler( - self.rfile, stdout, self.get_stderr(), self.get_environ() - ) - handler.request_handler = self # backpointer for logging - handler.run(self.server.get_app()) - finally: - stdout.detach() + handler = ServerHandler( + self.rfile, self.wfile, self.get_stderr(), self.get_environ() + ) + handler.request_handler = self # backpointer for logging + handler.run(self.server.get_app()) |