[stdlib-sig] socket.makefile() questions

Timothy Bower tim at ksu.edu
Mon Feb 1 03:56:54 CET 2010


fd.flush() seems to be the secret - worked as expected in all tests.  If possible, I'd like to suggest that the documentation be updated to explicitly say that a buffered file object is returned unless the buffering parameter is set to 0 (zero).  Setting buffering = None (default value) still returns a buffered object, which seems a little counter intuitive, but acceptable if the documentation makes it clear.

Thank you. 

--
Tim Bower
Assistant Professor
Kansas State University at Salina
Computer Systems Technology

tim at ksu.edu

----- Original Message -----
From: "Timothy Bower" <tim at ksu.edu>
To: "Antoine Pitrou" <solipsis at pitrou.net>
Cc: "stdlib-sig" <stdlib-sig at python.org>
Sent: Sunday, January 31, 2010 5:37:20 PM GMT -06:00 US/Canada Central
Subject: Re: [stdlib-sig] socket.makefile() questions

You are correct that fd.flush() makes a difference.  I thought that flush() would only affect the ability to read after the write, but actually the data was not sent until the flush() operation.  I'll do some more testing.

Thank you.

--
Tim Bower
Assistant Professor
Kansas State University at Salina
Computer Systems Technology

tim at ksu.edu

----- Original Message -----
From: "Antoine Pitrou" <solipsis at pitrou.net>
To: "stdlib-sig" <stdlib-sig at python.org>
Sent: Sunday, January 31, 2010 5:18:34 PM GMT -06:00 US/Canada Central
Subject: Re: [stdlib-sig] socket.makefile() questions


> fd = s.makefile('w', buffering = 0) -> ValueError exception
> fd = s.makefile('w') -> io.BufferedWriter, which does not send data.
> fd = s.makefile('wb') -> io.TextIOWrapper, which does not send data.

Have you tried fd.flush() after writing your data?



_______________________________________________
stdlib-sig mailing list
stdlib-sig at python.org
http://mail.python.org/mailman/listinfo/stdlib-sig
_______________________________________________
stdlib-sig mailing list
stdlib-sig at python.org
http://mail.python.org/mailman/listinfo/stdlib-sig


More information about the stdlib-sig mailing list