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 loewis
Recipients giampaolo.rodola, larry, loewis, neologix, serhiy.storchaka, vstinner
Date 2012-06-23.08:38:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1340440737.23.0.496009598502.issue15078@psf.upfronthosting.co.za>
In-reply-to
Content
I indeed think that the code is fine as it stands, and no change is needed, and that the proposed changes make matters worse.

The point of the thin wrappers approach is that you can read the manpage of your system, and immediately can trust that this is what the Python function will do. It is unfortunate that BSD and Linux have chosen to give the function the same name despite the signature differences, but there is no value in hiding this fact from the Python user.

The whole point of this function is performance and zero copy. Anybody using it will need to understand well what they are doing, and that their code is highly system-dependent. If you want cross-platform code, use shutil.copyfileobj.

I could agree to a higher-level function that tries to avoid system differences, but that function shouldn't be called sendfile. For example, the socket object could have a sendfd or sendstream method which would use the proper variant of sendfile if available, else uses a regular read/send loop.

I always found the name "sendfile" confusing, anyway, since it's not the file that is being sent, but the all (or some) of the contents of the file.
History
Date User Action Args
2012-06-23 08:38:59loewissetrecipients: + loewis, vstinner, larry, giampaolo.rodola, neologix, serhiy.storchaka
2012-06-23 08:38:57loewissetmessageid: <1340440737.23.0.496009598502.issue15078@psf.upfronthosting.co.za>
2012-06-23 08:38:55loewislinkissue15078 messages
2012-06-23 08:38:50loewiscreate