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 neologix
Recipients akira, asvetlov, christian.heimes, giampaolo.rodola, josh.r, josiah.carlson, neologix, pitrou, rosslagerwall
Date 2014-04-23.07:44:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAH_1eM02UGNB=UWQhnpe0WY6ghb9HxOaMseaSebw4wKffddW_w@mail.gmail.com>
In-reply-to <1398188985.97.0.436309259821.issue17552@psf.upfronthosting.co.za>
Content
1) I really don't like the use_fallback argument: as a user, I don't
care if it's using sendfile/splice/whatever WIndows uses.
I view this as a channel transfer (like Java's
http://docs.oracle.com/javase/7/docs/api/java/nio/channels/FileChannel.html#transferFrom(java.nio.channels.ReadableByteChannel,
long, long)), which moves bytes around from one FD to another.
If the user want precise control, he can just go ahead and call the
syscall itself.
Apart from complicating the prototype, what do this bring?

2) Just returning the number of bytes sent is fine

3) I really don't like the blocksize argument. Just use a really large
value internally to minimize the number of syscalls, that's all that
matters. I've *never* seen code which explicitly uses a blocksize: in
99% of cases, it just uses stat to find out the file size, and call
sendfile with it. Trying to be consistent with ftplib is IMO a bad
idea, since the API is just completely broken (I mean, just
sending/retrieving a file is complex). A useful parameter instead
would be to support sending only part of the file, so adding a count
argument.

You can have a look at
http://docs.oracle.com/javase/7/docs/api/java/nio/channels/FileChannel.html#transferFrom(java.nio.channels.ReadableByteChannel,
long, long) for an example many people bash Java, but they've designed
some great APIs :-)
History
Date User Action Args
2014-04-23 07:44:46neologixsetrecipients: + neologix, pitrou, giampaolo.rodola, christian.heimes, josiah.carlson, asvetlov, akira, rosslagerwall, josh.r
2014-04-23 07:44:46neologixlinkissue17552 messages
2014-04-23 07:44:45neologixcreate