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 jmadden
Recipients Jonathan Kamens, Paolo Veglia, jmadden, marcjofre, martin.panter, pje
Date 2016-04-03.23:01:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1459724468.55.0.996654685775.issue24291@psf.upfronthosting.co.za>
In-reply-to
Content
`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:])
History
Date User Action Args
2016-04-03 23:01:08jmaddensetrecipients: + jmadden, pje, martin.panter, Jonathan Kamens, marcjofre, Paolo Veglia
2016-04-03 23:01:08jmaddensetmessageid: <1459724468.55.0.996654685775.issue24291@psf.upfronthosting.co.za>
2016-04-03 23:01:08jmaddenlinkissue24291 messages
2016-04-03 23:01:08jmaddencreate