Message262835
`self.stdin` and `self.stderr` are documented to be `wsgi.input` and `wsgi.errors`, which are both described as "file-like" objects, meaning that the `write` method should return bytes written. It seems like the same could reasonably be said to be true for `self.stdout`, though it isn't strictly documented as such.
The WSGI spec says that each chunk the application yields should be written immediately, with no buffering (https://www.python.org/dev/peps/pep-3333/#buffering-and-streaming), so I don't think having the default output stream be buffered would be in compliance.
If there is a compatibility problem, writing the loop this way could bypass it (untested):
def _write(self, data):
written = self.stdout.write(data)
while written is not None and written < len(data):
written += self.stdout.write(data[written:]) |
|
Date |
User |
Action |
Args |
2016-04-03 23:01:08 | jmadden | set | recipients:
+ jmadden, pje, martin.panter, Jonathan Kamens, marcjofre, Paolo Veglia |
2016-04-03 23:01:08 | jmadden | set | messageid: <1459724468.55.0.996654685775.issue24291@psf.upfronthosting.co.za> |
2016-04-03 23:01:08 | jmadden | link | issue24291 messages |
2016-04-03 23:01:08 | jmadden | create | |
|