[issue17552] Add a new socket.sendfile() method

2014-06-10 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- keywords: +3.2regression -needs review, patch resolution: -> fixed status: open -> closed ___ Python tracker ___ __

[issue17552] Add a new socket.sendfile() method

2014-06-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 001895c39fea by Giampaolo Rodola' in branch 'default': fix issue #17552: add socket.sendfile() method allowing to send a file over a socket by using high-performance os.sendfile() on UNIX. Patch by Giampaolo Rodola'· http://hg.python.org/cpython/re

[issue17552] Add a new socket.sendfile() method

2014-06-10 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: OK then, I'll trust your judgement. I'll use 8K as the default and will commit the patch soon. -- assignee: -> giampaolo.rodola ___ Python tracker

[issue17552] Add a new socket.sendfile() method

2014-06-10 Thread Charles-François Natali
Charles-François Natali added the comment: >> I agree, but both points are addressed by sendfile() > > I'm talking about send(), not sendfile(). > Please remember that send() will be used as the default on Windows or when > non-regular files are passed to the function. My argument is about > in

[issue17552] Add a new socket.sendfile() method

2014-06-10 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > I agree, but both points are addressed by sendfile() I'm talking about send(), not sendfile(). Please remember that send() will be used as the default on Windows or when non-regular files are passed to the function. My argument is about introducing an ar

[issue17552] Add a new socket.sendfile() method

2014-06-10 Thread Charles-François Natali
Charles-François Natali added the comment: > I agree it is not necessary for sendfile() (you were right). Good we agree :-) > Do not introducing it for send(), though, poses some questions. > For instance, should we deprecate or ignore 'blocksize' argument in ftplib as > well? Honestly, we sh

[issue17552] Add a new socket.sendfile() method

2014-06-10 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Charles, Antoine, any final thought about this given the reasons I stated above? If you're still -1 about adding 'send_blocksize' argument I guess I can get rid of it and perhaps reintroduce it later if we see there's demand for it. --

[issue17552] Add a new socket.sendfile() method

2014-06-07 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: ...speaking of which, now that I look back at those benchmarks it looks like 65536 bytes is the best compromise (in my latest patch I used 16348). -- ___ Python tracker ___

[issue17552] Add a new socket.sendfile() method

2014-06-07 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I agree it is not necessary for sendfile() (you were right). Do not introducing it for send(), though, poses some questions. For instance, should we deprecate or ignore 'blocksize' argument in ftplib as well? Generally speaking, when using send() there are c

[issue17552] Add a new socket.sendfile() method

2014-06-07 Thread Charles-François Natali
Charles-François Natali added the comment: > Looking back at this I think a "send_blocksize" argument is necessary after > all. shutil.copyfileobj() has it, so is ftplib.FTP.storbinary() and httplib > (issue 13559) which will both be using socket.sendfile() once it gets > included. Those API

[issue17552] Add a new socket.sendfile() method

2014-06-07 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Looking back at this I think a "send_blocksize" argument is necessary after all. shutil.copyfileobj() has it, so is ftplib.FTP.storbinary() and httplib (issue 13559) which will both be using socket.sendfile() once it gets included. Updated patch is in attac

[issue17552] Add a new socket.sendfile() method

2014-04-26 Thread STINNER Victor
Changes by STINNER Victor : -- title: socket.sendfile() -> Add a new socket.sendfile() method ___ Python tracker ___ ___ Python-bugs-l