This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients Jonathan Kamens, Paolo Veglia, jmadden, marcjofre, martin.panter, pje
Date 2016-04-03.22:14:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1459721648.73.0.238343241384.issue24291@psf.upfronthosting.co.za>
In-reply-to
Content
Okay now I see the conflict. The use of WSGIRequestHandler with wbufsize = 0 was the missing key. I see two possible solutions:

1. Change SimpleHandler._write() to allow self.stdout to be a RawIOBase writer, and loop over stdout.write() until all the data is written. This seems to be what most people are suggesting here. But it requires that stdout.write() returns the number of bytes written, so could be a compatibility problem.

2. Document that the SimpleHandler(stdout=...) parameter should be a BufferedIOBase writer, and fix WSGIRequestHandler to pass in a BufferedWriter (by overriding the wbufsize attribute with -1 or io.DEFAULT_BUFFER_SIZE).

I am not super familiar with the wsgiref package, but the second option seems more preferable to me and more in line with my understanding of how it was intended to work.
History
Date User Action Args
2016-04-03 22:14:08martin.pantersetrecipients: + martin.panter, pje, jmadden, Jonathan Kamens, marcjofre, Paolo Veglia
2016-04-03 22:14:08martin.pantersetmessageid: <1459721648.73.0.238343241384.issue24291@psf.upfronthosting.co.za>
2016-04-03 22:14:08martin.panterlinkissue24291 messages
2016-04-03 22:14:08martin.pantercreate