[issue25063] shutil.copyfileobj should internally use os.sendfile when possible

2018-05-19 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___

[issue25063] shutil.copyfileobj should internally use os.sendfile when possible

2015-09-14 Thread R. David Murray
R. David Murray added the comment: I'm going to reject this. If you think there is enough value in this to warrant the complications that would be required to ensure backward compatibility (assuming that is even possible), you could bring it up again on python-ideas. -- resolution:

[issue25063] shutil.copyfileobj should internally use os.sendfile when possible

2015-09-13 Thread desbma
desbma added the comment: If I understand you correctly, a naive implementation like this: use_chunk_copy = False try: fdsrc = fsrc.fileno() fddst = fdst.fileno() except OSError: # fallback on current chunk based Python copy use_chunk_copy = True else: # we have 2 fd, try sendfile

[issue25063] shutil.copyfileobj should internally use os.sendfile when possible

2015-09-13 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___

[issue25063] shutil.copyfileobj should internally use os.sendfile when possible

2015-09-13 Thread Martin Panter
Martin Panter added the comment: I don’t know the exact reasoning, but fileno() could be useful for other purposes, e.g. passing to stat() to find the last modification time, passing to select() to see if data is available. -- ___ Python tracker

[issue25063] shutil.copyfileobj should internally use os.sendfile when possible

2015-09-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3d9cbbad8a04 by Martin Panter in branch '3.4': Issue #25063: socket.sendfile() does not exist in 3.4 https://hg.python.org/cpython/rev/3d9cbbad8a04 -- nosy: +python-dev ___ Python tracker

[issue25063] shutil.copyfileobj should internally use os.sendfile when possible

2015-09-10 Thread desbma
New submission from desbma: Sorry if it has already been discussed, or if this is a stupid idea. By looking at the signature, my thought was that the only use of shutil.copyfileobj was to wrap the use of sendfile, and use a fallback if it is not available on the system or not usable with

[issue25063] shutil.copyfileobj should internally use os.sendfile when possible

2015-09-10 Thread Martin Panter
Martin Panter added the comment: I agree it is a nice idea, but have the same concern as David. Many pseudo file objects wrap real file descriptors. E.g. BufferedReader hides unread data in a buffer, GzipFile decompresses data, HTTPResponse decodes chunks. Detecting when sendfile() is

[issue25063] shutil.copyfileobj should internally use os.sendfile when possible

2015-09-10 Thread R. David Murray
R. David Murray added the comment: No, it's to copy file like objects that aren't necessarily true file system objects. The only requirement is that they support a minimal file-like object interface. There is no suggestion or requirement that the object supports file descriptors (which