Message262833
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. |
|
Date |
User |
Action |
Args |
2016-04-03 22:14:08 | martin.panter | set | recipients:
+ martin.panter, pje, jmadden, Jonathan Kamens, marcjofre, Paolo Veglia |
2016-04-03 22:14:08 | martin.panter | set | messageid: <1459721648.73.0.238343241384.issue24291@psf.upfronthosting.co.za> |
2016-04-03 22:14:08 | martin.panter | link | issue24291 messages |
2016-04-03 22:14:08 | martin.panter | create | |
|