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 nikratio
Recipients docs@python, nikratio
Date 2013-04-21.21:24:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1366579468.26.0.0312151391842.issue17811@psf.upfronthosting.co.za>
In-reply-to
Content
The os.writev and os.readv functions are currently documented as:

os.writev(fd, buffers)

    Write the contents of buffers to file descriptor fd, where buffers is an arbitrary sequence of buffers. Returns the total number of bytes written.

os.readv(fd, buffers)

    Read from a file descriptor into a number of writable buffers. buffers is an arbitrary sequence of writable buffers. Returns the total number of bytes read.


This is rather confusing, mostly because it's not clear what can be passed as *buffer* (since buffer objects don't exist in Python 3 anymore), and (as a consequence) how the input will be distributed among the list of buffers.

Reading the code, it seems to me that any object that implements the buffer protocol would be fine, but that still doesn't help much in practice. From the memoryview documentation, I can infer that `bytes` implements the buffer protocol, but is also immutable, so how can something be written into it?

I'd be happy to write a patch to the documentation, but someone would need to explain to me first what kind of buffers are actually acceptable (and I suspect this will be different for readv and writev).
History
Date User Action Args
2013-04-21 21:24:28nikratiosetrecipients: + nikratio, docs@python
2013-04-21 21:24:28nikratiosetmessageid: <1366579468.26.0.0312151391842.issue17811@psf.upfronthosting.co.za>
2013-04-21 21:24:28nikratiolinkissue17811 messages
2013-04-21 21:24:28nikratiocreate