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-04.00:10:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1459728624.11.0.886289938166.issue24291@psf.upfronthosting.co.za>
In-reply-to
Content
I'm sorry, I'm still not following the argument that `write` is likely to return nothing. `RawIOBase` and `BufferedIOBase` both document that `write` must return the number of written bytes; if you don't return that, you break anything that assumes you do, as documented (because both patterns for checking if you need to keep looping are both TypeErrors: `written = 0; written += None` and `None < len(data)`); and if you ignore the return value, you fail when using any `IOBase` object that *isn't* buffered (exactly this case).

But you are definitely right, explicitly checking for None can be done. It adds a trivial amount of overhead, but this isn't a production server. The only cost is code readability.

Good point about the explicit calls to `flush()`, I thought flush was a no-op in some streams, but that's only the case for streams where it doesn't already matter.
History
Date User Action Args
2016-04-04 00:10:24jmaddensetrecipients: + jmadden, pje, martin.panter, Jonathan Kamens, marcjofre, Paolo Veglia
2016-04-04 00:10:24jmaddensetmessageid: <1459728624.11.0.886289938166.issue24291@psf.upfronthosting.co.za>
2016-04-04 00:10:24jmaddenlinkissue24291 messages
2016-04-04 00:10:23jmaddencreate