[issue10882] Add os.sendfile()

Giampaolo Rodola' report at bugs.python.org
Fri Jan 28 21:07:49 CET 2011


Giampaolo Rodola' <g.rodola at gmail.com> added the comment:

> Copy *count* bytes from file descriptor *in* to file descriptor 
> *out*, starting at *offset* and continuing for *count* bytes.

The latter part is incorrect as it is not guaranteed that all bytes specified in "count" argument are going to be sent and it also sounds like the function is blocking.
I'd change that in just "Copy *count* bytes from file descriptor *in* to file descriptor *out*."

Also, I'd be for using the BSD notation and rename the "count" argument to "nbytes", which is more clear.

Docstring should be changed to reflect the keyword arguments:
- sendfile(out, in, offset, count, headers, trailers, flags)\n\
+ sendfile(out, in, offset, count[, headers[, trailers], flags]]])\n\

Finally, tests for header and trailer arguments should be written.

The rest of the patch looks ok to me.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10882>
_______________________________________


More information about the Python-bugs-list mailing list