Re: [Python-Dev] Raw I/O writelines() broken

2012-08-20 Thread Cameron Simpson
On 21Aug2012 02:39, Andrea Griffini wrote: | On Mon, Aug 20, 2012 at 11:42 PM, Antoine Pitrou wrote: | >> In the spirit of RawIO.write(), I think RawIO.writelines() could return | >> the number of bytes written (allowing for partial writes). | | When dealing with a non-blocking IO what you norma

Re: [Python-Dev] Raw I/O writelines() broken

2012-08-20 Thread Andrea Griffini
On Mon, Aug 20, 2012 at 11:42 PM, Antoine Pitrou wrote: >> In the spirit of RawIO.write(), I think RawIO.writelines() could return >> the number of bytes written (allowing for partial writes). When dealing with a non-blocking IO what you normally do is use number returned from the write call to m

Re: [Python-Dev] Raw I/O writelines() broken

2012-08-20 Thread R. David Murray
On Mon, 20 Aug 2012 23:42:56 +0200, Antoine Pitrou wrote: > On Mon, 20 Aug 2012 23:17:10 +0200 > Antoine Pitrou wrote: > > > > Hello, > > > > I was considering a FileIO.writelines() implementation based on > > writev() and I noticed that the current RawIO.writelines() > > implementation is brok

Re: [Python-Dev] Raw I/O writelines() broken

2012-08-20 Thread Antoine Pitrou
On Mon, 20 Aug 2012 23:17:10 +0200 Antoine Pitrou wrote: > > Hello, > > I was considering a FileIO.writelines() implementation based on > writev() and I noticed that the current RawIO.writelines() > implementation is broken: RawIO.write() can return a partial write but > writelines() ignores the

[Python-Dev] Raw I/O writelines() broken

2012-08-20 Thread Antoine Pitrou
Hello, I was considering a FileIO.writelines() implementation based on writev() and I noticed that the current RawIO.writelines() implementation is broken: RawIO.write() can return a partial write but writelines() ignores the result and happily proceeds to the next iterator item (and None is retu