[Python-Dev] Draft PEP to make file objects support non-blocking
mode.
Greg Ewing
greg.ewing at canterbury.ac.nz
Mon Mar 21 06:32:36 CET 2005
> On 18 March 2005, Donovan Baarda said:
>>Many Python library methods and classes like select.select(), os.popen2(),
>>and subprocess.Popen() return and/or operate on builtin file objects.
>>However even simple applications of these methods and classes require the
>>files to be in non-blocking mode.
I don't agree with that. There's no need to use non-blocking
I/O when using select(), and in fact things are less confusing
if you don't.
>>The read method's current behaviour needs to be documented, so its actual
>>behaviour can be used to differentiate between an empty non-blocking read,
>>and EOF. This means recording that IOError(EAGAIN) is raised for an empty
>>non-blocking read.
Isn't that unix-specific? The file object is supposed to
provide a more or less platform-independent interface, I
thought.
--
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury, | A citizen of NewZealandCorp, a |
Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. |
greg.ewing at canterbury.ac.nz +--------------------------------------+
More information about the Python-Dev
mailing list