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 severb
Recipients amaury.forgeotdarc, christian.heimes, pitrou, severb
Date 2008-12-31.12:12:50
SpamBayes Score 2.985162e-11
Marked as misclassified No
Message-id <1230725572.69.0.11100419582.issue4263@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for the new implementation of MockNonBlockWriterIO class. It
makes tests so much easier to read.

There are some minor things in your patch that I would change. For example:

    # 1 byte will be written, the rest will be buffered
    raw.block_on(b"k")
    self.assertEquals(bufio.write(b"jklmn"), 5)
    # ...
    raw.block_on(b"0")

The comment is misleading because in fact no byte is written at raw
level. That's because the data size is smaller than the buffer size and
the buffer is empty (was emptied by the last write call). All this
renders raw.block_on(b"k") call useless. I also think this is the
correct behavior regardless of implementation language of BufferedWriter
class i.e. no write call should write at raw level smaller chunks of
data than buffer's size unless it has to.

Your tests can't cover the pre-flush condition because max_buffer_size
equals buffer_size.

Unless you'll beat me to it or prove me wrong, I'll update your patch
next year.
History
Date User Action Args
2008-12-31 12:12:52severbsetrecipients: + severb, amaury.forgeotdarc, pitrou, christian.heimes
2008-12-31 12:12:52severbsetmessageid: <1230725572.69.0.11100419582.issue4263@psf.upfronthosting.co.za>
2008-12-31 12:12:51severblinkissue4263 messages
2008-12-31 12:12:50severbcreate