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 tzickel
Recipients larry, tzickel
Date 2020-03-20.07:39:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1584689940.47.0.494767367712.issue40023@roundup.psfhosted.org>
In-reply-to
Content
os.writev and socket.sendmsg accept an iterable but the return value is number of bytes sent. That is not helpful as the user will have to write manual code to figure out which part of the iterable was not sent.

I propose to make a version of the functions where:

1. The return value is an iterable of the leftovers (including a maybe one-time memoryview into an item who has been partly-sent).

2. There is a small quirk where writev accepts only sequences but sendmsg accepts any iterable, which causes them not to behave the same for no good reason.

3. Do we want an sendmsgall like sendall in socket, where it doesn't give up until everything is sent ?

4. Today trying to use writev / sendmsg to be fully complaint requires checking the number of input items in the iterable to not go over IOV_MAX, maybe the python version of the functions should handle this automatically (and if it overflows, return the extra in leftovers) ?

Should the functions be the current one with an optional argument (return_leftovers) or a new function altogether.
History
Date User Action Args
2020-03-20 07:39:00tzickelsetrecipients: + tzickel, larry
2020-03-20 07:39:00tzickelsetmessageid: <1584689940.47.0.494767367712.issue40023@roundup.psfhosted.org>
2020-03-20 07:39:00tzickellinkissue40023 messages
2020-03-20 07:39:00tzickelcreate