summaryrefslogtreecommitdiffstats
path: root/Lib/wsgiref/handlers.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/wsgiref/handlers.py')
-rw-r--r--Lib/wsgiref/handlers.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/Lib/wsgiref/handlers.py b/Lib/wsgiref/handlers.py
index acb3547..f4300b8 100644
--- a/Lib/wsgiref/handlers.py
+++ b/Lib/wsgiref/handlers.py
@@ -450,7 +450,17 @@ class SimpleHandler(BaseHandler):
self.environ.update(self.base_env)
def _write(self,data):
- self.stdout.write(data)
+ result = self.stdout.write(data)
+ if result is None or result == len(data):
+ return
+ from warnings import warn
+ warn("SimpleHandler.stdout.write() should not do partial writes",
+ DeprecationWarning)
+ while True:
+ data = data[result:]
+ if not data:
+ break
+ result = self.stdout.write(data)
def _flush(self):
self.stdout.flush()